HTTPS request configuration

Updated at:
Copy as MD

The V2.0 SDK accesses Alibaba Cloud services over HTTPS by default. To switch protocols, set the protocol parameter of the com.aliyun.teaopenapi.models.Config class to HTTP or HTTPS. We recommend HTTPS for secure data transmission.

com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
config.setProtocol("HTTPS");

The SDK verifies SSL/TLS certificates by default for HTTPS connections. If your environment lacks the required certificates, verification may fail. Use the ignoreSSL parameter of the com.aliyun.teautil.models.RuntimeOptions class to skip certificate verification. For example, set ignoreSSL to true in a staging environment to bypass verification during testing.

Important

Enable SSL/TLS certificate validation in production environments.

com.aliyun.teautil.models.RuntimeOptions runtimeOptions = new com.aliyun.teautil.models.RuntimeOptions();
// true: skip certificate validation, false: validate certificates (default is false)
runtimeOptions.ignoreSSL = true;