-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL certificates not used by pipenv lock #2110
Comments
Erm. Don’t run |
It won’t be able to access your company’s specific certificates if you do that |
(It still might not, in which case set |
Setting the environment variable worked. I wonder why |
We bundle requests with our own PEM and so does pip. Try installing |
Maybe pipenv should respect the |
Pipenv doesn’t respect or not respect any environment variables or settings, it simply invokes a vendored copy of pip which includes a certificate file |
What if you open a python console and do |
Sorry for the delay. I get SSL errors if I use |
@edwardreed81 no worries, if you run from pipenv.vendor import requests
print(requests.__file__)
print(requests.certs.where())
from requests import certs
print(certs.where()) What do you get as your outputs? |
>>> from pipenv.vendor import requests
>>> print(requests.__file__)
/usr/lib/python3.6/site-packages/pipenv/vendor/requests/__init__.py
>>> print(requests.certs.where())
/usr/lib/python3.6/site-packages/pipenv/vendor/certifi/cacert.pem
>>> from requests import certs
>>> print(certs.where())
/usr/lib/python3.6/site-packages/pipenv/vendor/certifi/cacert.pem That seems suspect to me; where is EDIT: more investigation: >>> import requests
>>> requests.certs.where()
'/etc/ssl/certs/ca-certificates.crt'
>>> import pipenv.vendor.requests as perequests
>>> perequests.certs.where()
'/usr/lib/python3.6/site-packages/pipenv/vendor/certifi/cacert.pem' |
You probably have the OpenSSL bindings installed which pick this up in regular requests. I’m not totally sure what we need to do to make this happen properly without the environment variable but I’ll find out for you |
Hey @edwardreed81, sorry I missed this issue when it started. The problem you're hitting is two separate versions of Requests. The one bundled with pipenv is Requests 2.11.1 which still had certificates packaged with Requests vs the Requests you have installed is (likely) Requests 2.18.4 which will detect certs on your machine. This is why you're seeing variance between the two imports. This was a fundamental change we made in Requests and is expected behaviour. We need to get our vendored copy of Requests updated in pipenv or simply removed if possible. We'll look into getting the issue resolved tomorrow hopefully. |
@nateprewitt the vendored version in pipenv is 2.18.4. It just includes the pem file still. I think it's just a matter of no longer including it and possibly unvendoring requests. |
Ok, if Requests is upgraded to 2.18.4, the pem file definitely shouldn’t be there. Let’s pull it out. |
#2193 will resolve this once merged. |
I am trying to use pipenv at work and am running into SSL certificate errors despite my company's certificates working in other applications, including
pip
and inrequests
:pipenv is able to download packages just fine, but locking runs into SSL problems. I was directed to open a new issue after checking my TLS version (it is 1.2) here: #591.
Please run
$ python -m pipenv.help
, and paste the results here.$ python -m pipenv.help output
Pipenv version:
'11.10.1'
Pipenv location:
'/usr/lib/python3.6/site-packages/pipenv'
Python location:
'/usr/bin/python'
Other Python installations in
PATH
:3.6
:/usr/bin/python3.6m
3.6
:/usr/bin/python3.6
3.6
:/bin/python3.6
3.6.5
:/usr/bin/python
3.6.5
:/bin/python
3.6.5
:/usr/bin/python3
3.6.5
:/bin/python3
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.6.5',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '4.16.3-1-ARCH',
'platform_system': 'Linux',
'platform_version': '#1 SMP PREEMPT Thu Apr 19 09:17:56 UTC 2018',
'python_full_version': '3.6.5',
'python_version': '3.6',
'sys_platform': 'linux'}
System environment variables:
BROWSER
COLORTERM
CONDA_SHLVL
DBUS_SESSION_BUS_ADDRESS
DESKTOP_SESSION
DISPLAY
GDMSESSION
GTK_MODULES
HOME
LANG
LOGNAME
LS_COLORS
MAIL
MOZ_PLUGIN_PATH
PATH
PWD
SHELL
SHLVL
TERM
USER
VTE_VERSION
WINDOWID
XAUTHORITY
XDG_CURRENT_DESKTOP
XDG_GREETER_DATA_DIR
XDG_RUNTIME_DIR
XDG_SEAT
XDG_SEAT_PATH
XDG_SESSION_DESKTOP
XDG_SESSION_ID
XDG_SESSION_PATH
XDG_SESSION_TYPE
XDG_VTNR
http_proxy
https_proxy
no_proxy
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/home/e330665/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
SHELL
:/usr/bin/fish
LANG
:en_US.UTF-8
PWD
:/home/e330665/sandbox/pipenv_test
Contents of
Pipfile
('/home/e330665/sandbox/pipenv_test/Pipfile'):toml
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
requests = "*"
[dev-packages]
[requires]
python_version = "3.6"
Expected result
Actual result
Steps to replicate
The text was updated successfully, but these errors were encountered: