GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-128035: Add ssl.HAS_PHA to detect libssl PHA support by WillChilds-Klein · Pull Request #128036 · python/cpython

Conversation

@WillChilds-Klein

@WillChilds-Klein WillChilds-Klein commented Dec 17, 2024 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Notes

Please see #128035's description.

Testing

  • CPython CI
  • confirmed that PHA-related tests no longer fail when CPython is built against AWS-LC
  • Issue: Add ssl.HAS_PHA to detect libssl PHA support #128035

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot mentioned this pull request Dec 17, 2024
Add ssl.HAS_PHA to detect libssl PHA support #128035
Closed
tomasr8
tomasr8 reviewed Dec 17, 2024
View reviewed changes

@tomasr8 tomasr8 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will also need a news entry :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

WillChilds-Klein reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/library/ssl.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz reviewed Dec 17, 2024
View reviewed changes
Comment thread Doc/library/ssl.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_httplib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Core_and_Builtins/2024-12-17-18-20-37.gh-issue-128035.JwqHdB.rst Outdated
@@ -0,0 +1 @@
TLSv1.3 post-handshake client authentication (PHA), often referred to as "mutual TLS" or "mTLS", allows TLS servers to authenticate client identities using digital certificates. This commit exposes a boolean property ``ssl.HAS_PHA`` to indicate whether the crypto library CPython is built against supports PHA, allowing python's test suite and consuming modules to branch accordingly.

@picnixz picnixz Dec 17, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A shorter NEWS should be written. The NEWS is a message that users will see (it's in the changelog). Some suggestion:

Indicate through :data:`ssl.HAS_PHA` whether the :mod:`ssl` module supports TLSv1.3
post-handshake client authentication (PHA). Patch by YOURNAME.

In addition, you should add a What's New entry in Doc/whatsnew/3.14.rst indicating the additional constant. Usually, the same message as for the NEWS entry can be reused (check the other entries for the formatting).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@WillChilds-Klein WillChilds-Klein Dec 17, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the guidance. I've updated the news and whatsnew files accordingly.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tomasr8 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@WillChilds-Klein
WillChilds-Klein marked this pull request as ready for review December 17, 2024 21:22
@bedevere-app bedevere-app Bot added the awaiting review label Dec 17, 2024
tomasr8
tomasr8 reviewed Dec 17, 2024
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Outdated
Comment on lines +73 to +75
* Indicate through :data:`ssl.HAS_PHA` whether the :mod:`ssl` module supports TLSv1.3
post-handshake client authentication (PHA). (Contributed by Will Childs-Klein in
:gh:`128036`.)

@tomasr8 tomasr8 Dec 17, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go under Improved modules. You can make a new section for ssl:

ssl
---

* Indicate through :data:`ssl.HAS_PHA` whether the :mod:`ssl` module supports TLSv1.3
  post-handshake client authentication (PHA). (Contributed by Will Childs-Klein in
  :gh:`128036`.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

WillChilds-Klein reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@WillChilds-Klein
WillChilds-Klein force-pushed the ssl-add-has-pha-property branch from 7f19054 to 6b11e12 Compare December 17, 2024 21:45
WillChilds-Klein and others added 8 commits December 18, 2024 10:03
@WillChilds-Klein
Add ssl.HAS_PHA to detect libssl PHA support
7293bec
@blurb-it @WillChilds-Klein
📜🤖 Added by blurb_it.
9543715
@WillChilds-Klein @tomasr8
Update Doc/library/ssl.rst
0c8f5dd
Co-authored-by: Tomas R. <[email protected]>
@WillChilds-Klein
Fix news lint
fcb7190
@WillChilds-Klein @picnixz
Update Doc/library/ssl.rst
f7850fd
Co-authored-by: Bénédikt Tran <[email protected]>
@WillChilds-Klein @picnixz
Update Lib/test/test_httplib.py
57ce78f
Co-authored-by: Bénédikt Tran <[email protected]>
@WillChilds-Klein
Shorten news entry, update whatsnew
65e6a0d
@WillChilds-Klein
Move whatsnew section
63df081
@WillChilds-Klein
WillChilds-Klein force-pushed the ssl-add-has-pha-property branch from 6b11e12 to 63df081 Compare December 18, 2024 15:03
@WillChilds-Klein
Fix whatsnew formatting
a3548a8
@WillChilds-Klein
WillChilds-Klein requested review from picnixz and tomasr8 December 23, 2024 13:20
picnixz
picnixz reviewed Dec 24, 2024
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering the precedent on HAS_PSK and conditional blake2 detection for OpenSSL-like implementations that do not support it, this an ok change.

Some questions:

  • is there an equivalent of OPENSSL_NO_PHA constant or not? (AFAIK, no, but are there some implementations that offer TLSv1.3 without PHA and would define OPENSSL_NO_PHA?)
  • is there a better constant than SSL_VERIFY_POST_HANDSHAKE to check if PHA is supported or not? namely, is there an implementation which supports PHA (whether by default or not) but uses another constant?

cc @gpshead for a second look as well

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

WillChilds-Klein reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/whatsnew/3.14.rst
Comment on lines +586 to +587
* Indicate through :data:`ssl.HAS_PHA` whether the :mod:`ssl` module supports
TLSv1.3 post-handshake client authentication (PHA).

@picnixz picnixz Dec 24, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Indicate through :data:`ssl.HAS_PHA` whether the :mod:`ssl` module supports
TLSv1.3 post-handshake client authentication (PHA).
* Indicate through :data:`ssl.HAS_PHA` whether the :mod:`ssl` module
supports TLSv1.3 post-handshake client authentication (PHA).

(just for reducing the line length and make it look more uniform, but this is entirely optional and a matter of taste; my previous suggestion may even have been incorrect in that regard).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gpshead
gpshead approved these changes Dec 24, 2024
View reviewed changes

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me. If there are better ways to determine this in the future, we can adapt to those. As with a lot of things libssl related... I feel like it can be configured via the environment in such ways that regardless of compile time checks capabilities can be changed at runtime via its configs. This constant only covers if the library could support it, but isn't able to express if it happens to be enabled or not within the current process. That is fine and is the expected simple thing to do.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz and WillChilds-Klein reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Dec 24, 2024
@gpshead gpshead self-assigned this Dec 24, 2024
@gpshead gpshead added type-feature A feature request or enhancement topic-SSL labels Dec 24, 2024
@gpshead
gpshead enabled auto-merge (squash) December 24, 2024 18:29
@gpshead
gpshead merged commit 418114c into python:main Dec 24, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Dec 24, 2024
@WillChilds-Klein
WillChilds-Klein deleted the ssl-add-has-pha-property branch December 27, 2024 18:23
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
@WillChilds-Klein @tomasr8
@picnixz @srinivasreddy
pythongh-128035: Add ssl.HAS_PHA to detect libssl PHA support (python…
8ad4e87
…GH-128036)

* Add ssl.HAS_PHA to detect libssl Post-Handshake-Auth support

Co-authored-by: Tomas R. <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
@WillChilds-Klein WillChilds-Klein mentioned this pull request May 7, 2025
gh-133623: Add ssl.HAS_PSK_TLS13 to detect external TLS 1.3 PSK support #133624
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz left review comments
@gpshead gpshead gpshead approved these changes
@tomasr8 tomasr8 Awaiting requested review from tomasr8

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gpshead gpshead

Labels

topic-SSL type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@WillChilds-Klein @gpshead @tomasr8 @picnixz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.