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
net/http: Extend to allow client certificate authentication for HTTPS? #11802
Comments
Use make your own We probably won't make this any easier, as it's an uncommon request and already composeable with the pieces provided. |
I'm sorry if I wasn't clear enough, but I did specify that this was for the server-side. Not client. (As in, the Go HTTPS server library being able to authenticate connecting clients). Though after some digging it looks like it can possibly be modified here where the config is specified. Combined with some of the logic pulled from here You may want to spend a few extra seconds reading the issue before closing it next time, hmm? |
Sorry. Can't you just check the request.TLS field to see the cert presented? |
Yeah, looks like I can. In this bit of code, however, it looks like the config is built with the client authentication in mind. In ListenAndServeTLS, there is this where the configuration is passed in. I could see a function like:
... being something that could be useful with little modification needed to add the extra step to specify:
|
Looks like this too suffices:
|
I suggest that it might be quite nice to extend the standard library for HTTPS servers to be able to easily specify client certificates for use in authentication of connections. If this is already possible, I have not found the necessary documentation to assist in that end, but an API exposure of this sort would be quite nice!
The text was updated successfully, but these errors were encountered: