I have an application which I'm doing self-signing certificates for using the documentation here.
The application loads that keystore into a jetty config and loads properly and I get a warning of an untrusted certification when browsing to the site.
Then I want to use python to connect to it and I've tried all variations of generating a cert, pem, etc. nothing I do gets me to connect. Simply doing the following -
import requests
requests.get('https://servername:8443', cert=('path
o\cert\app.cert', '\\path\to\keystore\keystore'))
Gives me the following traceback -
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:Python27libsite-packages
equestsapi.py", line 69, in get
return request('get', url, params=params, **kwargs)
File "C:Python27libsite-packages
equestsapi.py", line 50, in request
response = session.request(method=method, url=url, **kwargs)
File "C:Python27libsite-packages
equestssessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "C:Python27libsite-packages
equestssessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "C:Python27libsite-packages
equestsadapters.py", line 431, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL] PEM lib (_ssl.c:2580)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…