Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Validate certificate EKU #1764

Closed
danroth27 opened this issue Apr 25, 2017 · 12 comments
Closed

Validate certificate EKU #1764

danroth27 opened this issue Apr 25, 2017 · 12 comments
Assignees
Milestone

Comments

@danroth27
Copy link
Member

When setting up SSL with Kestrel if the cert has an EKU we should validate that the cert is for server usage.

@muratg
Copy link
Contributor

muratg commented Jun 23, 2017

@blowdart your thoughts on this one? (OK to do in 2.1?)

@blowdart
Copy link
Member

No, as we patched full framework to check for this last month. It needs to be right on the server too.

@natemcmaster
Copy link
Contributor

@muratg @halter73 I might be able to poach this one if we still want to get it in for 2.0.0

@muratg muratg assigned natemcmaster and unassigned halter73 Jul 7, 2017
@muratg
Copy link
Contributor

muratg commented Jul 7, 2017

Thanks @natemcmaster! If we can't get to it, it's probably OK.

@davidfowl
Copy link
Member

Is this really important for 2.0? Wasn't this for the identity service scenario?

@danroth27
Copy link
Member Author

@davidfowl This was requested by @blowdart and applies to HTTPS with Kestrel independent of the identity as a service work.

@blowdart
Copy link
Member

blowdart commented Jul 7, 2017

It's very separate.

Both Core and Framework now check the EKUs of the servers they're attaching to. So if you bind an invalid certificate then HttpClient et al will refuse to connect. This check on startup ensures that you're not using a certificate that isn't meant to be for a server, and so warns you a lot earlier than waiting for an HttpClient to attach.

It's a nice to have, but it's very very very nice, because it'll make things easier to diagnose.

@davidfowl
Copy link
Member

I think it should be moved to 2.1 but if @natemcmaster can do it and it's low risk (has a low chance of regressions on all 3 OSes) then sure.

@natemcmaster
Copy link
Contributor

The check is actually fairly simple. The hardest part of doing this was figuring out how to make a test cert with an EKU extension. I have a PR open to implement EKU validation here: #1940.

@muratg
Copy link
Contributor

muratg commented Jul 7, 2017

@halter73 / @davidfowl could you review the PR?

@natemcmaster if this is risky, let's move it out to 2.1.

@natemcmaster
Copy link
Contributor

In #1940, we added validation of the Extended Key Usage extension. In #1944, I'm adding the validation for the normal Key Usage extension as well. According to the RFC, validation of these extensions is an orthogonal concern so we don't need both, however, it seems best to be consistent and check both types of key usage extensions.

@natemcmaster
Copy link
Contributor

Talked with @blowdart in person. We can address the Key Usage extension separately, and do that post 2.1. Closing this as resolved with changes in #1940. I've opened #1946 to address this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants