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

TLS peer certificate #1058

Open
cruz3rblade opened this issue May 16, 2024 · 5 comments
Open

TLS peer certificate #1058

cruz3rblade opened this issue May 16, 2024 · 5 comments

Comments

@cruz3rblade
Copy link
Contributor

cruz3rblade commented May 16, 2024

Hey,

I am interested in using mTLS and verifying the client's peer certificate. Based on issue #589 from 3 years ago, it seems that this was not supported at the time. Is this feature currently supported, or are there any plans to support it in the future?

@uNetworkingAB
Copy link
Contributor

Are you asking about peer verification in general or using mTLS as the SSL implementation?

@cruz3rblade
Copy link
Contributor Author

I'm asking in general, basically I want to retrieve the peer's certificate in its raw form, like how NodeJS expose it with tlsSocket.getPeerCertificate. Then, I could verify the certificate using crypto.X509Certificate.verify.

@uNetworkingAB
Copy link
Contributor

This is a feature that has never been fully thought about yet, I've only seen very few people interested in it and for those in C++ land they can access all OpenSSL functions but for Node.js it needs to be wrapped in some simple way. It would be a feature request

@cruz3rblade
Copy link
Contributor Author

I understand, and yet please consider fulfilling this feature request in the future. 🙏
Also, Thank you for the quick reply and this awesome library!

@theoephraim
Copy link

I'm trying to implement mTLS as well. Using @cruz3rblade's example and things seem to be working, but I'd like to be able to make mTLS requests from the browser as well. If I understand correctly, when doing this with node's built-in https module, you must set an option of requestCert: true. Is this just not supported with uWS, or am I missing some other step?

Obviously I need to install the client cert locally as well, but I would expect that chrome might show me a popup or something to select the cert as well? It seems there's just nothing being sent, which makes me think the server is not requesting it properly.

Thanks so much!

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

No branches or pull requests

3 participants