我正在执行一个HDFC银行API,我需要发送SSL证书来验证身份。为此,我使用python的请求库。但是我犯了个错误
Raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='openapiuat.hdfcbank.com', port=9443): Max retries exceeded with url: /API/IMPSPayment (Caused by SSLError(SSLError(336445449, '[SSL] PEM lib (_ssl.c:3717)')))"
cert_file_path = "newArhamCert.crt"
key_file_path = "newArhamPrivate.key"
cert = (cert_file_path, key_file_path)
json_payload = {
"RequestSignatureEncryptedValue": RequestSignatureEncryptedValue,
"SymmetricKeyEncryptedValue": SymmetricKeyEncryptedValue,
"Scope": "**********",
"TransactionId": "12122020DECARH3",
"OAuthTokenValue": accessToken,
}
convertes_json = json.dumps(json_payload, indent = 4)
headers = {
'user-agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
'apikey' : '***************************************',
'Content-Type': 'application/json',
}
endpoint_url = 'https://openapiuat.hdfcbank.com:9443/API/IMPSPayment'
json_responce = requests.post(endpoint_url, headers=headers, data=convertes_json, cert=cert)
print(json_responce.text)
目前没有回答
相关问题 更多 >
编程相关推荐