Repository navigation
Closed
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/tiran'
closed_at = <Date 2018-02-24.20:52:43.134>
created_at = <Date 2015-05-30.20:37:28.364>
labels = ['3.7', 'expert-SSL', '3.8', 'type-bug', 'library']
title = 'SSLSocket extra level of indirection'
updated_at = <Date 2018-03-24.14:59:18.615>
user = 'https://github.com/tiran'bugs.python.org fields:
activity = <Date 2018-03-24.14:59:18.615>
actor = 'christian.heimes'
assignee = 'christian.heimes'
closed = True
closed_date = <Date 2018-02-24.20:52:43.134>
closer = 'christian.heimes'
components = ['Library (Lib)', 'SSL']
creation = <Date 2015-05-30.20:37:28.364>
creator = 'christian.heimes'
dependencies = []
files = ['39570']
hgrepos = []
issue_num = 24334
keywords = ['patch']
message_count = 9.0
messages = ['244494', '244495', '246168', '246277', '312753', '312754', '312755', '314368', '314371']
nosy_count = 8.0
nosy_names = ['geertj', 'janssen', 'pitrou', 'giampaolo.rodola', 'christian.heimes', 'alex', 'martin.panter', 'dstufft']
pr_nums = ['5252', '5857', '6211', '6212']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue24334'
versions = ['Python 3.7', 'Python 3.8']
Activity
tiran commentedon May 30, 2015
I just noticed that bpo-21965 has added an extra level of indirection to the SSLSocket object. In Python 3.4 and earlier the ssl.SSLSocket object has one level of indirection:
In 3.5 an additional level comes into play:
Method calls like SSLSocket.read() now call SSLObject.read(), which call _SSLSocket.read(). That seems a bit excessive. Isn't there a better way with less indirections?
I have created a proof-of-concept patch that removes the extra layer with some code duplication. Maybe the common code can be moved into a commmon base class for SSLObject and SSLSocket? After all both classes provide a similar interface.
pitrou commentedon May 30, 2015
I'm nosying Geert, who is the original author of the SSLObject code.
geertj commentedon Jul 3, 2015
Apologies for the late reply.
I made SSLSocket go through SSLObject so that the test suite that is primarily testing SSLSocket will test both.
Also, this layering allows us to define some non-networked operations (such as SSL certificate checking and channel binding types) in a single location rather than duplicating them between SSLSocket and SSLObject.
pitrou commentedon Jul 4, 2015
Indeed, I like the fact it makes test coverage broader.
Of course, if there's another way to get such coverage without duplicating lots of code, then why not.
tiran commentedon Feb 24, 2018
New changeset 141c5e8 by Christian Heimes in branch 'master':
bpo-24334: Cleanup SSLSocket (bpo-5252)
141c5e8
tiran commentedon Feb 24, 2018
New changeset 8fa8478 by Christian Heimes (Miss Islington (bot)) in branch '3.7':
[3.7] bpo-24334: Cleanup SSLSocket (GH-5252) (bpo-5857)
8fa8478
tiran commentedon Feb 24, 2018
Thanks for your review, Antoine!
tiran commentedon Mar 24, 2018
New changeset e42ae91 by Christian Heimes in branch 'master':
bpo-24334: Remove inaccurate match_hostname call (bpo-6211)
e42ae91
tiran commentedon Mar 24, 2018
New changeset 1a0bb62 by Christian Heimes (Miss Islington (bot)) in branch '3.7':
[3.7] bpo-24334: Remove inaccurate match_hostname call (GH-6211) (bpo-6212)
1a0bb62