我正在尝试从SOAP获取密码,它使用p12证书,并且正在获得ssl证书验证

2024-05-15 05:44:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图从SOAP获取密码,但得到了一个错误,我也不知道我必须在哪里指定p12文件的密码,以便它可以读取。我给出了密钥库中的p12文件路径

import requests
url="myurl"
#headers = {'content-type': 'application/soap+xml'}
headers = {'content-type': 'application/soap+xml','Name': 'Request','Message Size': '358','Encoding': 'UTF-8','Endpoint': 'endpointurl','Follow Redirects': 'true','Authorization Type': 'No Authorization','SSL Keystore': "p12 filepath",'Disable multiparts': 'true','Pretty Print': 'true'}

body = """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ejb3="http://ejb3.pwAccel.edmz.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <ejb3:handleRequestWS>
         <systemName>systemname</systemName>
         <accountName>username</accountName>
      </ejb3:handleRequestWS>
   </soapenv:Body>
</soapenv:Envelope>"""

response = requests.post(url,data=body,headers=headers)
print response.content

错误消息:

raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verif
y failed (_ssl.c:661)

Tags: 文件trueurl密码applicationtype错误xml

热门问题