All Products
Search
Document Center

Alibaba Cloud SDK:Configure an HTTPS request

Last Updated:Sep 04, 2023

Configure an HTTPS request in Alibaba Cloud Darabonba SDK for Python V2.0

Alibaba Cloud Darabonba SDK for Python V2.0 allows you to specify the protocol over which API requests are sent for an SDK client. We recommend that you send API requests over HTTPS. If you do not specify the protocol, API requests are sent over HTTPS by default.

from alibabacloud_tea_openapi.models import Config

config = Config(
    protocol='HTTPS'  # Send API requests over HTTPS.
)
Important

By default, if you send an API request over HTTPS, the SDK enables certificate verification to verify the validity of SSL/TLS certificates. If no SSL/TLS certificate is configured in the development environment, an error that indicates the certificate verification fails is reported.

To ensure network communication security, we recommend that you enable certificate verification. If certificate verification must be disabled in the test environment, you can set the ignore_ssl parameter to True when you specify runtime parameters.

from alibabacloud_tea_util.models import RuntimeOptions

RuntimeOptions(
    ignore_ssl=True  # Disable certificate verification. By default, certificate verification is enabled.
)