RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1565943 - Don't recommend ssl.wrap_socket()
Summary: Don't recommend ssl.wrap_socket()
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: Red_Hat_Enterprise_Linux-Release_Notes-7-en-US
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Lenka Špačková
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-11 06:37 UTC by Christian Heimes
Modified: 2019-03-06 01:04 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Deprecated Functionality
Doc Text:
sslwrap() removed from Python The sslwrap() function has been removed from Python 2.7. After the 466 Python Enhancement Proposal (https://www.python.org/dev/peps/pep-0466/) was implemented, using this function resulted in a segmentation fault. The removal is consistent with upstream. Red Hat recommends using the ssl.SSLContext class and the ssl.SSLContext.wrap_socket() function instead. Most applications can simply use the ssl.create_default_context() function, which creates a context with secure default settings. The default context uses the system's default trust store, too.
Clone Of:
Environment:
Last Closed: 2018-04-17 15:56:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1331425 0 unspecified CLOSED Segmentation fault in sslwrap function 2021-02-22 00:41:40 UTC

Description Christian Heimes 2018-04-11 06:37:12 UTC
Document URL: 
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.5_release_notes/chap-red_hat_enterprise_linux-7.5_release_notes-deprecated_functionality

Section Number and Name: 
sslwrap() removed from Python

Describe the issue: 
The section recommends ssl.wrap_socket() as replacement for sslwrap. As upstream maintainer of Python's ssl module and Red Hat security engineer for IdM, I strongly advise against the function. ssl.wrap_socket() has multiple deficiencies. Most importantly the function is insecure. It doesn't validate host names and opens applications to MitM attacks. Further more the function has no option to load the system trust store, so applications have to hard-code the path to CA cert bundle. Application developers usually don't bother and rather disable cert validation. The function is also inefficient. It has to parse cert, key, and CA and create a temporary SSLContext object for every call.

Suggestions for improvement: 
Please advise users to use ssl.SSLContext and ssl.SSLContext.wrap_socket() instead. Most applications can simply use ssl.create_default_context(), which creates a context with secure default settings. The default context uses the system's default trust store, too.

>>> import ssl
>>> ctx = ssl.create_default_context()
>>> ctx.wrap_socket(sock, server_hostname=HOSTNAME)


Additional information: 
ssl.wrap_socket() will be deprecated soon, too.

Comment 2 Lenka Špačková 2018-04-11 08:33:33 UTC
Hi Christian, 
Thanks a lot for your suggestion. Please review the proposed doc text and let me know if this is sufficient.

Charis, you were the original reporter in BZ#1331425, please let me know if you have any suggestions, too.

Once I get acks from both of you, I will republish RHEL 7.3, 7.4, and 7.5 Release Notes with this fix.

Thanks!

Comment 3 Christian Heimes 2018-04-16 14:17:16 UTC
LGTM

Thanks, Lenka!

Comment 4 Charalampos Stratakis 2018-04-16 14:41:50 UTC
LGTM as well!


Note You need to log in before you can comment on or make changes to this bug.