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

ClientCertificateMode now read from config #18759

Closed
wants to merge 1 commit into from

Conversation

kuns200
Copy link
Contributor

@kuns200 kuns200 commented Feb 3, 2020

Client certificate mode can now be read from config file.
It uses, connectionreader.cs
Addresses #18660


private IConfiguration _configuration;
private IDictionary<string, CertificateConfig> _certificates;
private IList<EndpointConfig> _endpoints;
private EndpointDefaults _endpointDefaults;

private string _clientCertificateMode;
Copy link
Member

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?

}
}


Copy link
Member

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()
Copy link
Member

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.

Copy link
Member

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];
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}


private static HttpProtocols? ParseProtocols(string protocols)
private static HttpProtocols? ParseProtocols(string protocols)
Copy link
Member

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
{

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

var reader = new ConfigurationReader(config);
var clientCertificateMode = reader.ClientCertificateMode;
Assert.NotNull(clientCertificateMode);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

var reader = new ConfigurationReader(config);
var clientCertificateMode = reader.ClientCertificateMode;
Assert.Null(clientCertificateMode);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

@analogrelay analogrelay added this to the 5.0.0-preview1 milestone Feb 11, 2020
@kuns200
Copy link
Contributor Author

kuns200 commented Feb 12, 2020

ok . will make changes.

@halter73
Copy link
Member

@kuns200 Do you have time to look at this again? Thanks.

@shirhatti
Copy link
Contributor

@kuns200 Are you still interested in doing this?

@BrennanConroy
Copy link
Member

@kuns200 If you're still interested you can open a new PR

@kuns200
Copy link
Contributor Author

kuns200 commented May 5, 2021

I was busy last year with few things at home. Can I look this now? Or is it done?

@ghost
Copy link

ghost commented May 5, 2021

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.

@BrennanConroy
Copy link
Member

Looks like it got done via #24076

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants