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

gh-112454: Disable TLS-PSK if OpenSSL was built without PSK support #112491

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

grantramsay
Copy link
Contributor

@grantramsay grantramsay commented Nov 28, 2023

  • If OpenSSL was built without PSK support, the python TLS-PSK methods will raise NotImplementedError if called
  • Add a constant ssl.HAS_PSK to check if TLS-PSK is supported

As a side note (a mistake I made when trying to test this), make sure to build OpenSSL with:

./Configure no-psk

and not:

./Configure -DOPENSSL_NO_PSK

otherwise OPENSSL_NO_PSK is not available in the OpenSSL public headers.

CC: @gpshead


📚 Documentation preview 📚: https://cpython-previews--112491.org.readthedocs.build/

…port

If OpenSSL was built without PSK support, the python TLS-PSK
methods will raise "NotImplementedError" if called.

Add a constant "ssl.HAS_PSK" to check if TLS-PSK is supported
@grantramsay
Copy link
Contributor Author

@ayappanec can you check if this fixes your issue?

@ayappanec
Copy link
Contributor

@ayappanec can you check if this fixes your issue?

Yes, it works with this fix.

@gpshead
Copy link
Member

gpshead commented Nov 29, 2023

Thanks for the pre-release testing ayappanec!

@gpshead gpshead self-assigned this Nov 29, 2023
@gpshead gpshead merged commit e413daf into python:main Nov 29, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…port (python#112491)

If OpenSSL was built without PSK support, the python TLS-PSK
methods will raise "NotImplementedError" if called.

Add a constant "ssl.HAS_PSK" to check if TLS-PSK is supported
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…port (python#112491)

If OpenSSL was built without PSK support, the python TLS-PSK
methods will raise "NotImplementedError" if called.

Add a constant "ssl.HAS_PSK" to check if TLS-PSK is supported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants