Skip to content

Conversation

@bbockelm
Copy link
Collaborator

When users visit XRootD-based HTTP servers in the browser, they get a pop-up request for selecting a client certificate. This is fairly disruptive for users not working in X.509-based environments -- and completely unnecessary if X.509 authentication is not in use!

This PR adds two new options, tlsclientauth and tlsrequiredprefix, that control when the HTTPS server may request a client certificate. Note that this only makes sense for the HTTPS protocol and hence isn't part of the generic XrdTls configuration.


http.tlsclientauth [on|off|defer]

Controls the use of client certificate authentication only for the HTTPS protocol. When on (default), the HTTPS protocol server will always request a client certificate from the client. When off, it will never request a certificate. When set to defer, it will only request a client certificate is it is in a path specified by https.tlsrequiredprefix.

It is not an error if the client does not provide a certificate.

http.tlsrequiredprefix /prefix

This option, which can be specified multiple times, specifies a prefix that requires the use of TLS client certificate authentication. If a HTTP request is made for a path starting with this prefix and http.tlsclientauth is in defer mode, then the HTTP server will request a client certificate from the client before a response is made.

Note this only works with clients that support the post-handshake authentication option in TLS 1.3 (these include curl 7.62 or later and the curl version shipped with RHEL8 or later).

@bbockelm bbockelm force-pushed the defer_clientauth branch 2 times, most recently from 534cb31 to 0025cd1 Compare May 17, 2024 20:55
abh3
abh3 previously requested changes Jun 14, 2024
Copy link
Member

@abh3 abh3 left a comment

Choose a reason for hiding this comment

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

In addition to the requested changes. Since "Note this only works with clients that support the post-handshake authentication option in TLS 1.3 (these include curl 7.62 or later and the curl version shipped with RHEL8 or later)." the obvious question is what happens if you set this option but the client doesn't support it? Failure,? Odd error? Since we have to support a wide mix of clients , getting into a situation where sometimes this works and sometimes not is not particularly appealing. What is the mitigation here?

@amadio amadio force-pushed the devel branch 4 times, most recently from 472b0ee to e358ac0 Compare July 3, 2024 12:40
@xrootd-dev
Copy link

xrootd-dev commented Jul 24, 2024 via email

@bbockelm bbockelm force-pushed the defer_clientauth branch 2 times, most recently from 1930490 to db61ad6 Compare August 30, 2024 18:17
@bbockelm bbockelm force-pushed the defer_clientauth branch 2 times, most recently from 53d0726 to 1d7b0e0 Compare September 5, 2024 21:24
@bbockelm bbockelm marked this pull request as draft September 5, 2024 21:38
@bbockelm
Copy link
Collaborator Author

bbockelm commented Sep 5, 2024

(Note: converting the PR back to "draft" status until Emma has a chance to re-test)

@bbockelm
Copy link
Collaborator Author

Summary of in-person discussion:

  • Brian will move new OpenSSL API invocation into XrdTls, even if it's a static function in the directory.
  • Similarly, any #ifdef around OpenSSL version in this PR will be migrated to the XrdTls directory.
  • The implementation of the BIO nonblocking, since it's in the middle of the existing BIO configuration function in HTTP, will be kept where it is.

@bbockelm bbockelm marked this pull request as ready for review September 14, 2024 18:31
@bbockelm
Copy link
Collaborator Author

@abh3 - requested changes were completed.

@amadio amadio requested a review from abh3 September 14, 2024 22:22
@bbockelm bbockelm changed the base branch from devel to master January 28, 2025 15:50
@bbockelm
Copy link
Collaborator Author

As mentioned a few weeks back, I'm quite happy to share that it seems like we made the needed transition with this patch out-of-tree, greatly simplifying this to be an on/off and dropping the use of the TLS 1.3 extension.

Accordingly, as this is pretty much a rewrite (particularly, removing the most controversial pieces), I'm dismissing the old reviews and re-requesting a fresh review.

@bbockelm
Copy link
Collaborator Author

@abh3 / @amadio - kind reminder of this PR. In case it wasn't clear from the previous comments, it's been completely reworked since last discussed. Hence, I re-requested a review in GitHub.

@amadio
Copy link
Member

amadio commented Feb 24, 2025

Hi @bbockelm, we will review it and consider it for 5.8. Thanks!

amadio
amadio previously requested changes Feb 24, 2025
Copy link
Member

@amadio amadio left a comment

Choose a reason for hiding this comment

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

There are still some things which I don't understand. Maybe it's due to the refactoring, but it seems to me that the setting should be passed in the constructor of the TLS context and afterwards it will not change, so nothing should be really needed in XrdHttpProtocol.cc. We should have tls.clientauth option implemented similarly to xrd.tls and xrd.tlsca, that is, independent of the protocol.

@bbockelm
Copy link
Collaborator Author

bbockelm commented Mar 5, 2025

@amadio - thanks for the review! I just wanted to ACK I saw it and will try to get to this over the weekend.

@bbockelm bbockelm requested a review from amadio March 15, 2025 21:29
@bbockelm
Copy link
Collaborator Author

@amadio - in the latest revision, I overhauled the patch so setting the context's configuration each time was no longer needed and to include integration tests that the patch was working. Life is better, of course, with test coverage.

@bbockelm
Copy link
Collaborator Author

bbockelm commented Apr 9, 2025

@amadio and I discussed the PR. One last thing to check -- when client auth is disabled but the client still tries to present a certificate, what happens?

If the server can still parse & verify the certificate when it has been presented one unprompted, then we should allow this and rename the knob something like "disable client certificate request". Reading the OpenSSL docs, I don't think this is possible -- but would be nice if it was!

Otherwise, what we have is about the best we can do.

@bbockelm bbockelm force-pushed the defer_clientauth branch from 8f63016 to db0dc46 Compare May 18, 2025 21:26
@bbockelm
Copy link
Collaborator Author

@amadio - Performed the investigation requested above.

There's no way for the client to "send unprompted" the certificate (it's a protocol violation). Thus, there's no way to disable the server from prompting for a client certificate but verifying one if the client sends it regardless.

Per our conversation last month, I think this is the best we can do. I think it's ready to merge for the next feature release.

@amadio amadio added this to the 5.9.0 milestone May 18, 2025
@bbockelm bbockelm force-pushed the defer_clientauth branch from db0dc46 to 58c47a1 Compare May 18, 2025 21:43
@amadio amadio moved this to In review in Release Planning May 20, 2025
@amadio amadio dismissed their stale review September 3, 2025 11:43

All comments have been addressed, looks good to me to go into XRootD 5.9.0.

The X.509 client auth request is fairly disruptive for communities
that are browser-based (since this is an extremely uncommon flow
for users -- and most of them interpret the certificate request
as an error message) and not using X.509 client auth.

This provides a boolean (defaulting to "on") that allows the administrator
to turn off X.509 client auth when not needed / desired.

Also included is test coverage for when the boolean is on and off.
@amadio amadio dismissed abh3’s stale review September 8, 2025 14:58

All comments have been addressed.

@amadio amadio merged commit 25da01f into xrootd:master Sep 8, 2025
11 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Release Planning Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants