Skip to content
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

ignore_ssl_certs failure on Python 2.7 #296

Closed
adiroiban opened this issue Dec 7, 2021 · 1 comment
Closed

ignore_ssl_certs failure on Python 2.7 #296

adiroiban opened this issue Dec 7, 2021 · 1 comment

Comments

@adiroiban
Copy link

adiroiban commented Dec 7, 2021

Many thanks for this nice tool!

A quick fix for python 2.7

-        context = ssl.SSLContext()
+        context = ssl.SSLContext(ssl.PROTOCOL_TLS)

in py2.7 you need to specify the SSL protocol

Error details for a run like nodeenv --ignore_ssl_certs --prebuilt build-server/nodeenv

  File "/home/adi/chevah/server/build-server/lib/python2.7/site-packages/nodeenv.py", line 1068, in main
    opt.node = get_last_stable_node_version()
  File "/home/adi/chevah/server/build-server/lib/python2.7/site-packages/nodeenv.py", line 1002, in get_last_stable_node_version
    return _get_versions_json()[0]['version'].lstrip('v')
  File "/home/adi/chevah/server/build-server/lib/python2.7/site-packages/nodeenv.py", line 978, in _get_versions_json
    response = urlopen('%s/index.json' % src_base_url)
  File "/home/adi/chevah/server/build-server/lib/python2.7/site-packages/nodeenv.py", line 603, in urlopen
    context = ssl.SSLContext()
TypeError: __new__() takes at least 2 arguments (1 given)

context = ssl.SSLContext()

@ekalinin
Copy link
Owner

ekalinin commented Dec 8, 2021

Thanks for the report!

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

No branches or pull requests

2 participants