-
Notifications
You must be signed in to change notification settings - Fork 10.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
ClientCertificateMode now read from config #18759
Conversation
|
||
private IConfiguration _configuration; | ||
private IDictionary<string, CertificateConfig> _certificates; | ||
private IList<EndpointConfig> _endpoints; | ||
private EndpointDefaults _endpointDefaults; | ||
|
||
private string _clientCertificateMode; |
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.
Can we make this type ClientCertificateMode?
} | ||
} | ||
|
||
|
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.
Nit: remove the extra newline above and below property.
@@ -65,6 +80,10 @@ public IEnumerable<EndpointConfig> Endpoints | |||
} | |||
} | |||
|
|||
private void ReadClientCertificateMode() |
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.
This should do the enum parsing instead of LoadClientCertificateMode in KestrelConfigurationLoader.
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.
Compare to ParseProtocols
private void ReadClientCertificateMode() | ||
{ | ||
_clientCertificateMode = _configuration[ClientCertificateModeKey]; | ||
} |
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.
} | |
} | |
|
||
private static HttpProtocols? ParseProtocols(string protocols) | ||
private static HttpProtocols? ParseProtocols(string protocols) |
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.
Undo this.
@@ -12,6 +12,28 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Tests | |||
{ | |||
public class ConfigurationReaderTests | |||
{ | |||
|
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.
var reader = new ConfigurationReader(config); | ||
var clientCertificateMode = reader.ClientCertificateMode; | ||
Assert.NotNull(clientCertificateMode); | ||
} |
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.
} | |
} | |
var reader = new ConfigurationReader(config); | ||
var clientCertificateMode = reader.ClientCertificateMode; | ||
Assert.Null(clientCertificateMode); | ||
} |
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.
} | |
} | |
ok . will make changes. |
@kuns200 Do you have time to look at this again? Thanks. |
@kuns200 Are you still interested in doing this? |
@kuns200 If you're still interested you can open a new PR |
I was busy last year with few things at home. Can I look this now? Or is it done? |
Hi @kuns200. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Looks like it got done via #24076 |
Client certificate mode can now be read from config file.
It uses,
connectionreader.cs
Addresses #18660