Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.03 KB

7-Https-EN.md

File metadata and controls

47 lines (35 loc) · 1.03 KB

HTTPS Configurations

Use HTTPS Protocol

SDK uses http protocol as default

from aliyunsdkecs.request.v20140526.DescribeInstancesRequest import DescribeInstancesRequest
from aliyunsdkcore.client import AcsClient

client = AcsClient(
    '<access_key_id>', # AccessKey ID
    '<access_secret>', # Access Key Secret
    '<region_id>', # Region ID
)

request = DescribeInstancesRequest()
request.set_protocol_type('https')  # Use https

client.do_action_with_exception(request)

Ignore certificate

from aliyunsdkcore.client import AcsClient

client = AcsClient(
    '<access_key_id>', # AccessKey ID
    '<access_secret>', # Access Key Secret
    '<region_id>', # Region ID
    verify=False  # Ignore verifying the SSL certificate
)

Specify CA certificate

from aliyunsdkcore.client import AcsClient

client = AcsClient(
    '<access_key_id>', # AccessKey ID
    '<access_secret>', # Access Key Secret
    '<region_id>', # Region ID
    verify='./cacert.pem'  # Path to certificates of trusted CA
)