SecretId and SecretKey.python -V
pip list

requests is missing, install it with pip install requests.pip install -i https://mirrors.tencent.com/pypi/simple/ --upgrade tencentcloud-sdk-python
tencentcloud-sdk-python/tencentcloud/ssl directory, such as apply.py, add the following code in the file and run.import json,base64from time import time,sleepfrom tencentcloud.common import credentialfrom tencentcloud.common.profile.client_profile import ClientProfilefrom tencentcloud.common.profile.http_profile import HttpProfilefrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKExceptionfrom tencentcloud.ssl.v20191205 import ssl_client, modelsstart = time()#SecretId: Your API SecretID; SecretKey: Your API SecretKey.cred = credential.Credential("SecretId", "SecretKey")httpProfile = HttpProfile()httpProfile.endpoint = "ssl.tencentcloudapi.com"clientProfile = ClientProfile()clientProfile.httpProfile = httpProfiledomain_name = []while True:domain = input('the domain for which a certificate is applied')#Enter the domain to be bound with the certificate you are applying for; if you don’t want to continue, press Enter.if domain == '':breakelse:domain_name.append(domain)for i in range(len(domain_name)):client = ssl_client.SslClient(cred, "", clientProfile)try:req = models.ApplyCertificateRequest()params = {"DvAuthMethod": "DNS_AUTO","DomainName": domain_name[i]}req.from_json_string(json.dumps(params))resp = client.ApplyCertificate(req)response = json.loads(resp.to_json_string())print('domain: {0}material submitted, auto-verification in 5s'.format(domain_name[i]))certid = response['CertificateId']sleep(5)try:req1 = models.CompleteCertificateRequest()params1 = {"CertificateId": certid}req1.from_json_string(json.dumps(params1))resp1 = client.CompleteCertificate(req1)response1 = json.loads(resp1.to_json_string())print('doman: {0}verified successfully. Prepare to download the certificate'.format(domain_name[i]))try:req2 = models.DownloadCertificateRequest()params2 = {"CertificateId": certid}req2.from_json_string(json.dumps(params2))resp2 = client.DownloadCertificate(req2)response2 = json.loads(resp2.to_json_string())# print(response2['Content'])content = response2['Content']with open("{0}.zip".format(domain_name[i]), "wb") as f:f.write(base64.b64decode(content))f.close()except TencentCloudSDKException as err:print(err)except TencentCloudSDKException as err:print(err)except TencentCloudSDKException as err:print(err)end = time()print('This code execution takes', round(end - start, 2), 's')

Feedback