Repository navigation
Closed
Description
$ nix-shell --pure -p python34 -p python34Packages.dbus
[nix-shell:~]$ python3
Python 3.4.3 (default, Jan 01 1970, 00:00:01)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.request
>>> urllib.request.urlopen("https://news.google.com");
Traceback (most recent call last):
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/urllib/request.py", line 1182, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/http/client.py", line 1088, in request
self._send_request(method, url, body, headers)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/http/client.py", line 1126, in _send_request
self.endheaders(body)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/http/client.py", line 1084, in endheaders
self._send_output(message_body)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/http/client.py", line 922, in _send_output
self.send(msg)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/http/client.py", line 857, in send
self.connect()
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/http/client.py", line 1231, in connect
server_hostname=server_hostname)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/ssl.py", line 365, in wrap_socket
_context=self)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/ssl.py", line 583, in __init__
self.do_handshake()
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/ssl.py", line 810, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/urllib/request.py", line 161, in urlopen
return opener.open(url, data, timeout)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/urllib/request.py", line 463, in open
response = self._open(req, data)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/urllib/request.py", line 481, in _open
'_open', req)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/urllib/request.py", line 441, in _call_chain
result = func(*args)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/urllib/request.py", line 1225, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/nix/store/1kfab8hs8d94f9n0xcscn6pzyqkwc9g1-python3-3.4.3/lib/python3.4/urllib/request.py", line 1184, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>
Cc @domenkozar
Metadata
Metadata
Assignees
Labels
No labels
Activity
obadz commentedon Jul 17, 2015
Nevermind setting SSL_CERT_FILE fixes it.
obadz commentedon Jul 17, 2015
Reopening: this fails for
whereas the cert looks fine when opening in Chromium.
obadz commentedon Jul 17, 2015
copumpkin commentedon Jul 17, 2015
@obadz would probably help if you included the type of failure. Does it just not know the root? Consider the certificate malformed? Some other violation?
obadz commentedon Jul 17, 2015
exception is visibly identical to the one I pasted above:
Not sure how I can get more details.
Looks like this error isn't specific to Python: curl also complains about the cert:
Maybe an issue with cacert? Does chromium not use cacert (I don't see a reference to it in the Chromium nix file)?
vcunat commentedon Jul 18, 2015
Are you sure that your curl can see that
SSL_CERT_FILEvariable? Beware ofnix-shell --purefor this! EDIT: mycurl https://internal-tuner.pandora.com/works fine.obadz commentedon Jul 18, 2015
Further details on trying to access https://internal-tuner.pandora.com/:
@vcunat on staging:
Could access with: curl, firefox
Got cert error with: python
@kmicu on "master~40ish"
Could access with: nothing
Got cert error with: curl, python, conkeror (firefox), chromium (every app)
@obadz on nixos-unstable (6ad8fab):
Could access with: firefox, chromium
Got cert error with: curl, python
@lethalman on older unstable:
Could access with: chromium
Everyone could access https://news.google.com/ from all apps.
@vcunat, @kmicu & myself have matching md5sum $SSL_CERT_FILE
[EDITED to fix @vcunat 's observations and clarify]
[-]Python 3.4: ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)[/-][+]Mysteriously inconsistent SSL Cert behavior with different nixpkgs versions / apps for a particular site[/+]obadz commentedon Jul 18, 2015
Should clarify: "able to access" = "no cert validation error"
vcunat commentedon Jul 18, 2015
No, I'm the other way. Curl and FF get no cert error and python3 does.
obadz commentedon Jul 18, 2015
Edited comment to reflect that.
obadz commentedon Jul 18, 2015
Ok ignore previous comment, fixing observations and summarizing gives us this:
For https://internal-tuner.pandora.com/:
Browsers (Chromium, Firefox) think certs are fine.
Python thinks certs are invalid.
Curl thinks certs are invalid on nixos-unstable/master but Ok on staging.
https://news.google.com/ works for all apps.
md5sum $SSL_CERT_FILE remains constant throughout
globin commentedon Jul 18, 2015
Nixos-built cargo (not binary snapshot) has similar problems #8872
FRidh commentedon Jul 1, 2016
Is this the same as #15571? If not, please reopen.