java - generating cert for use with python requests getting PEM lib error -


i have application i'm doing self-signing certificates using documentation here.

the application loads keystore jetty config , loads , warning of untrusted certification when browsing site.

then want use python connect , i've tried variations of generating cert, pem, etc. nothing gets me connect. doing following -

import requests requests.get('https://servername:8443', cert=('path\ \to\\cert\\app.cert', '\\\\path\\to\\keystore\\keystore')) 

gives me following traceback -

traceback (most recent call last):   file "<stdin>", line 1, in <module>   file "c:\python27\lib\site-packages\requests\api.py", line 69, in     return request('get', url, params=params, **kwargs)   file "c:\python27\lib\site-packages\requests\api.py", line 50, in request     response = session.request(method=method, url=url, **kwargs)   file "c:\python27\lib\site-packages\requests\sessions.py", line 465, in request     resp = self.send(prep, **send_kwargs)   file "c:\python27\lib\site-packages\requests\sessions.py", line 573, in send     r = adapter.send(request, **kwargs)   file "c:\python27\lib\site-packages\requests\adapters.py", line 431, in send     raise sslerror(e, request=request) requests.exceptions.sslerror: [ssl] pem lib (_ssl.c:2580) 

cert in requests used client site certificates, not ca store. use verify parameter specify ca file, e.g.:

requests.get('https://www.example.com', verify='/etc/ssl/certs/ca-certificates.crt') 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -