ceph / python-jenkins Goto Github PK
View Code? Open in Web Editor NEWfork of python-jenkins for https://review.openstack.org/460363
License: Other
fork of python-jenkins for https://review.openstack.org/460363
License: Other
If I utilize a self signed certificate and calling any function, e.g. whoami
, the the following exception will be raised
>>> server = jenkins.Jenkins('https://my-host', username='my_user', password='123456')
>>> server.get_whoami()
Traceback (most recent call last):
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\urllib3\connection.py", line 411, in connect
self.sock = ssl_wrap_socket(
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\urllib3\util\ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\urllib3\util\ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Python\3.9\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Python\3.9\lib\ssl.py", line 1040, in _create
self.do_handshake()
File "C:\Python\3.9\lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\urllib3\util\retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='my-host', port=443): Max retries exceeded with url: /testing/crumbIssuer/api/json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\jenkins\__init__.py", line 793, in get_whoami
response = self.jenkins_open(requests.Request(
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\jenkins\__init__.py", line 557, in jenkins_open
return self.jenkins_request(req, add_crumb, resolve_auth).text
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\jenkins\__init__.py", line 573, in jenkins_request
self.maybe_add_crumb(req)
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\jenkins\__init__.py", line 370, in maybe_add_crumb
response = self.jenkins_open(requests.Request(
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\jenkins\__init__.py", line 557, in jenkins_open
return self.jenkins_request(req, add_crumb, resolve_auth).text
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\jenkins\__init__.py", line 576, in jenkins_request
self._request(req))
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\jenkins\__init__.py", line 550, in _request
return self._session.send(r, **_settings)
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\casabre\Documents\my_project\.venv\lib\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='my-host', port=443): Max retries exceeded with url: /testing/crumbIssuer/api/json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1129)')))
It would be quite helpful to have a flag, e. g. ssl_verify=False
, in order to skip certificate checking if you are working in an environment were self signed certificates are mandatory.
Thanks
Carsten
setup.py is missing 'install_requires=['setuptools']'.
See here: https://github.com/ceph/python-jenkins/blob/master/jenkins/plugins.py#L45
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.