optimizely / python-sdk

Python SDK for Optimizely Feature Experimentation and Optimizely Full Stack (legacy)
https://docs.developers.optimizely.com/experimentation/v4.0.0-full-stack/docs/python-sdk
Apache License 2.0
32 stars 36 forks source link

[FSSDK-10317] Remove PyOpenSSL and cryptography from requirements #435

Closed Mat001 closed 4 months ago

Mat001 commented 4 months ago

Summary

PyOpenSSL and cryptography packages are no longer required and can potentially introduce a security risk as pointed out by PeterJCLaw in his reported GitHub issue.

Sdk used to use requests extra option requests[security] that included PyOpenSSL and cryptography packages to enhance SSL/TLS support, particularly for older versions of Python that lacked certain security features.

The requests[security] extra was officially deprecated in version 2.25.0 of the requests library, released on November 11, 2020. The deprecation notice indicated that this extra would be removed in version 2.26.0. The primary reason for deprecation was the improved native SSL/TLS support in modern Python versions, making the extra dependencies redundant.

Based on the above we replaced requests[security] with its components including PyOpenSSL and cryptography. But it looks like we didn't need to do so.

According to research, users are now encouraged to rely on the native SSL/TLS support provided by Python's standard library. The requests library itself continues to support secure HTTP requests (HTTPS) out of the box, leveraging the built-in ssl module in Python.

We removed Py v2.x and some older Py 3.x versions and so we can now use native SSL/TLS support in modern Python versions we're using. If all tests are passing then PyOpenSSL and cyptography can be safely removed.

Test plan

Issues