Skip to content

bpo-32951: Disable SSLSocket/SSLObject constructor #5864

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

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

tiran
Copy link
Member

@tiran tiran commented Feb 24, 2018

Direct instantiation of SSLSocket was never documented nor tested. It
had limitations, too. For example it was not possible to enabled
hostname verification except through ssl_version=PROTOCOL_TLS_CLIENT
with cert_reqs=CERT_REQUIRED.

The only test case for direct instantiation was added a couple of days
ago for IDNA testing.

Signed-off-by: Christian Heimes [email protected]

https://bugs.python.org/issue32951

@tiran tiran force-pushed the sslsocket_no_instance branch from f26412b to fa2aa15 Compare February 25, 2018 17:23
@tiran tiran changed the title Remove support for instantiation of SSLSocket bpo-32951: Disable SSLSocket/SSLObject constructor Feb 25, 2018
@tiran tiran requested review from pitrou and alex February 25, 2018 17:24
Direct instantiation of SSLSocket and SSLObject objects is now prohibited.
The constructors were never documented, tested, or designed as public
constructors. The SSLSocket constructor had limitations. For example it was
not possible to enabled hostname verification except was
ssl_version=PROTOCOL_TLS_CLIENT with cert_reqs=CERT_REQUIRED.

SSLContext.wrap_socket() and SSLContext.wrap_bio are the recommended API
to construct SSLSocket and SSLObject instances. ssl.wrap_socket() is
also deprecated.

The only test case for direct instantiation was added a couple of days
ago for IDNA testing.

Signed-off-by: Christian Heimes <[email protected]>
@tiran tiran force-pushed the sslsocket_no_instance branch from fa2aa15 to 47984b8 Compare February 27, 2018 08:23
@tiran tiran merged commit 9d50ab5 into python:master Feb 27, 2018
@bedevere-bot
Copy link

@tiran: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @tiran, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 9d50ab563df6307cabbcc9883cb8c52c614b0f22 3.7

tiran added a commit to tiran/cpython that referenced this pull request Feb 27, 2018
Direct instantiation of SSLSocket and SSLObject objects is now prohibited.
The constructors were never documented, tested, or designed as public
constructors. The SSLSocket constructor had limitations. For example it was
not possible to enabled hostname verification except was
ssl_version=PROTOCOL_TLS_CLIENT with cert_reqs=CERT_REQUIRED.

SSLContext.wrap_socket() and SSLContext.wrap_bio are the recommended API
to construct SSLSocket and SSLObject instances. ssl.wrap_socket() is
also deprecated.

The only test case for direct instantiation was added a couple of days
ago for IDNA testing.

Signed-off-by: Christian Heimes <[email protected]>
(cherry picked from commit 9d50ab5)

Co-authored-by: Christian Heimes <[email protected]>
@bedevere-bot
Copy link

GH-5925 is a backport of this pull request to the 3.7 branch.

tiran added a commit that referenced this pull request Feb 27, 2018
…5925)

Direct instantiation of SSLSocket and SSLObject objects is now prohibited.
The constructors were never documented, tested, or designed as public
constructors. The SSLSocket constructor had limitations. For example it was
not possible to enabled hostname verification except was
ssl_version=PROTOCOL_TLS_CLIENT with cert_reqs=CERT_REQUIRED.

SSLContext.wrap_socket() and SSLContext.wrap_bio are the recommended API
to construct SSLSocket and SSLObject instances. ssl.wrap_socket() is
also deprecated.

The only test case for direct instantiation was added a couple of days
ago for IDNA testing.

Signed-off-by: Christian Heimes <[email protected]>
(cherry picked from commit 9d50ab5)

Co-authored-by: Christian Heimes <[email protected]>
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.

5 participants