HTTPS相关配置
更新时间:2023-05-16
下列代码中对函数入参c即是CdnClient对象,详情参见CdnClient
设置https
Python
1def test_set_domain_https(c):
2 """
3 test_set_domain_https
4 """
5 https = {
6 'enabled': True,
7 'certId': 'cert-rm45x46isit4',
8 }
9 response = c.set_domain_https('test.example.com', https)
10 print(response)
设置ocsp
当域名开启了https时才能开启ocsp配置
Python
1def test_set_ocsp(c):
2 """
3 test_set_ocsp
4 """
5 ocsp = False
6 response = c.set_domain_ocsp('example.test.com', ocsp)
7 print(response)
查询ocsp配置
Python
1def test_get_ocsp(c):
2 """
3 test_get_ocsp
4 """
5 response = c.get_domain_ocsp('example.test.com')
6 print(response)