我正在尝试向(带有)正确证书的主机发送GET请求。
这是大学的任务,他们给了我这些证书。 (仅有效30秒)
但是下面的代码给了我certificate verify failed: self signed certificate
的错误
我从主机那里得到的响应是:[[致命错误:未知的CA。
什么可能导致此问题?谢谢! context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.load_cert_chain('clientcert.pem', keyfile='clientkey.pem')
connection = http.client.HTTPSConnection(IP)
connection.request("GET", "/")
response = connection.getresponse()
print("response:", response)
您也可以尝试使用与--insecure
中的curl
选项相同的选项。