Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

SSL support should be provided to support HTTPS based clients #77

Open
Kondasamy opened this issue May 8, 2019 · 2 comments
Open

SSL support should be provided to support HTTPS based clients #77

Kondasamy opened this issue May 8, 2019 · 2 comments

Comments

@Kondasamy
Copy link

Log traces below for https based client,

>>> print(client._test_connection())
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 344, in connect
    ssl_context=context)
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 347, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 412, in wrap_socket
    session=session
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 853, in _create
    self.do_handshake()
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1117, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)```
@cfournie
Copy link
Contributor

cfournie commented May 8, 2019

Looks like your local machine is missing the CA certificate for whichever SSL cert you're trying to use. You might be able to use the certifi package, as noted in this Stackoverflow answer to get the CA cert needed for verification. If not, inspect the SSL cert and see which CA cert you need and fetch that.

@Kondasamy
Copy link
Author

@cfournie : I have faced this issue once when I was using requests package. I believe providing an option to pass the cert parameter would work in this case.

https://2.python-requests.org/en/master/user/advanced/#client-side-certificates

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants