-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Add endpoint option to authenticate by client tls cert. #461
Conversation
cbafb7d
to
8074718
Compare
Hi @andersbetner, thanks for your contribution :)
WDYT? /cc @vdemeester @samber |
8074718
to
2d06ba7
Compare
@emilevauge The name ClientCAs is a bit of a misnomer, it doesn't hold client certificates. It contains the public key of one or more certificate authorities that you trust to sign client certs. Since this PR involves security it would be great if more than my pair of eyes could have a look at the code. |
Seems good to me 😉 |
True, obviously we cannot reuse
Even if a file can contain multiple keys, I think it would be simpler to not force users to do that. Besides, the std library as been designed with that in mind:
As soon as we agree on design, we will make a deep code review :) |
@emilevauge , @vdemeester I had a look around and it seems like Caddy does it like you suggested. Just to make sure I understand. type TLS struct {
Certificates Certificates
ClientCAFiles []string
} [entryPoints.https]
address = ":443"
ClientCAFiles = ["ca1.pem", "ca2.pem"]
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
CertFile = "integration/fixtures/https/snitest.com.crt"
KeyFile = "integration/fixtures/https/snitest.com.key" It is a pity that the authentication is forced on all SNI-certs on the same listener (by the go library), but I guess we are not alone there: Caddy issue #849 |
@andersbetner: Seems good.
|
Hi @andersbetner, I'm planning to get this PR in the 1.1 releases. Do you think it's possible ? |
@emilevauge |
@andersbetner it would be better to squash your commits yes :) |
2d06ba7
to
f4e4947
Compare
@emilevauge |
@@ -32,6 +32,7 @@ They can be defined using: | |||
- a port (80, 443...) | |||
- SSL (Certificates. Keys...) | |||
- redirection to another entrypoint (redirect `HTTP` to `HTTPS`) | |||
- authentication with a client certificate signed by a trusted CA |
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.
I would add this to the existing line SSL (Certificates. Keys...)
:)
f4e4947
to
f8a2b15
Compare
@emilevauge
|
Thanks @andersbetner ! /cc @containous/traefik |
@emilevauge |
f8a2b15
to
664bc9c
Compare
@emilevauge |
/cc @containous/traefik |
LGTM 🐯 |
I have added authentication by client certificate as per #402
I haven't added any tests yet.