The V2.0 SDK sends all requests over HTTPS by default. Two parameters control the communication protocol and SSL/TLS certificate verification.
Parameters
| Parameter | Class | Type | Default | Description |
|---|---|---|---|---|
Protocol | AlibabaCloud.OpenApiClient.Models.Config | String | "HTTPS" | Communication protocol. Valid values: HTTPS, HTTP. |
IgnoreSSL | AlibabaCloud.TeaUtil.Models.RuntimeOptions | Boolean | false | Skip SSL/TLS certificate verification. true: skip verification. false: verify certificates. |
Set the communication protocol
To change the protocol, set Protocol in Config. For secure data transmission, use HTTPS.
var config = new AlibabaCloud.OpenApiClient.Models.Config
{
// Other configurations are omitted.
Protocol = "HTTPS", // Valid values: HTTPS, HTTP. Default: HTTPS.
};Skip SSL/TLS certificate verification
The SDK verifies SSL/TLS certificates by default when you access services over HTTPS. If your environment lacks the required certificates, verification fails with a certificate error.
To skip certificate verification in a test environment, set IgnoreSSL to true in RuntimeOptions:
AlibabaCloud.TeaUtil.Models.RuntimeOptions runtime = new AlibabaCloud.TeaUtil.Models.RuntimeOptions
{
// true: skip certificate verification. false: verify certificates (default).
IgnoreSSL = true,
};Important
Always enable SSL/TLS certificate verification in production environments.