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

Fix SSL problems for old versions of Python 2.7.x #344

Merged
merged 4 commits into from
Nov 12, 2018

Conversation

andreagrandi
Copy link
Contributor

Hi,

with this patch we solved the connection probelms with urls using SSL when using an old version of Python, such as:

/usr/lib/venv/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.

pyasn1==0.4.4
pyOpenSSL==18.0.0
urllib3==1.23
enum34==1.1.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are all of these required? I can't see anything in the code about idna, ndg-httpsclient, pyasn1 and enum34

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idna for example is needed by pyOpenSSL https://github.com/urllib3/urllib3/blob/master/src/urllib3/contrib/pyopenssl.py#L11
the others I'm not sure about. I'm porting changes my team did in the last 2 years https://github.com/datagovuk/ckanext-harvest/commits/2.0 in a for we have and we would really love to merge these back upstream. Do you have any suggestion about how I could check if the other mentioned dependencies may not be needed? Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, we did more investigations on this and these are our findings:

  • enum34==1.1.6 and idna==2.7 are being installed by pyOpenSSL==18.0.0 (which we need to fix this TLS problem)
  • urllib3==1.23 is installed by requests

This leaves us with ndg-httpsclient==0.5.1 and pyasn1==0.4.4 which we are still not sure about. I will update this PR in the mean time and try to remove those libs from our environment to check if any other dependency is touched.

Cheers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right, I've removed the dependencies that were not needed. How does it look now? Cheers

@metaodi metaodi merged commit e66362d into ckan:master Nov 12, 2018
@metaodi
Copy link
Member

metaodi commented Nov 12, 2018

@andreagrandi Thank you very much!

metaodi added a commit that referenced this pull request Nov 12, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants