install.python-poetry.org icon indicating copy to clipboard operation
install.python-poetry.org copied to clipboard

Error: "curl: (60) SSL certificate problem: certificate has expired" when installing poetry via curl

Open yellowcandle opened this issue 2 years ago • 7 comments

When running curl -sSL https://install.python-poetry.org | python3 - , the following error occurs: curl: (60) SSL certificate problem: certificate has expired

yellowcandle avatar Jun 23 '23 06:06 yellowcandle

no it doesn't

perhaps you have time / date set wrong on your computer?

dimbleby avatar Jun 23 '23 07:06 dimbleby

$ echo | openssl s_client -showcerts -servername install.python-poetry.org -connect install.python-poetry.org:443 | openssl x509 -inform pem -noout -text

will show you the certificate, especially:

        Validity
            Not Before: May 13 23:07:47 2023 GMT
            Not After : Aug 11 23:07:46 2023 GMT

dimbleby avatar Jun 23 '23 07:06 dimbleby

Same here. (Using Terminal on MacOS Ventura 13.4.1)

➜  ~ curl -sSL https://install.python-poetry.org | python3 -     
Retrieving Poetry metadata
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1346, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1257, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1303, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1252, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1012, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 952, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1426, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 945, in <module>
  File "<stdin>", line 923, in main
  File "<stdin>", line 524, in run
  File "<stdin>", line 786, in get_version
  File "<stdin>", line 847, in _get
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1389, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1349, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)>

santosbio avatar Jul 03 '23 13:07 santosbio

UPDATE: For MacOS I've fixed by creating a symlink from OS certificates to Python:

sudo ln -s /etc/ssl/* /Library/Frameworks/Python.framework/Versions/3.9/etc/openssl

santosbio avatar Jul 03 '23 13:07 santosbio

that wasn't the same error anyway, this issue is (wrongly) reporting that the certificate has expired

dimbleby avatar Jul 03 '23 14:07 dimbleby

Same as here, I've already tried installing our home brew to pip, but it doesn't seem to work

File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1351, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)> allanpires@GHQ2RK667TG ~ %

AllanPires95 avatar Nov 06 '23 20:11 AllanPires95

sudo ln -s /etc/ssl/* /Library/Frameworks/Python.framework/Versions/3.9/etc/openssl

I've recebe this error when i tried to use this link allanpires@GHQ2RK667TG ~ % sudo ln -s /etc/ssl/* /Library/Frameworks/Python.framework/Versions/3.9/etc/openssl ln: /Library/Frameworks/Python.framework/Versions/3.9/etc/openssl: No such file or directory

AllanPires95 avatar Nov 06 '23 20:11 AllanPires95