Skip to content

ignore_ssl_certs failure on Python 2.7 #296

Closed

Description

@adiroiban

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()

Activity

  1. ekalinin commented on Dec 8, 2021

    @ekalinin
    Owner

    Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions