Make CertificateConfig linker friendly (#25515)

This commit is contained in:
Ben Adams 2020-09-02 17:19:13 +01:00 committed by GitHub
parent 474f947261
commit ab3799f651
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -353,7 +353,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal
public CertificateConfig(IConfigurationSection configSection)
{
ConfigSection = configSection;
ConfigSection.Bind(this);
// Bind explictly to preserve linkability
Path = configSection[nameof(Path)];
KeyPath = configSection[nameof(KeyPath)];
Password = configSection[nameof(Password)];
Subject = configSection[nameof(Subject)];
Store = configSection[nameof(Store)];
Location = configSection[nameof(Location)];
if (bool.TryParse(configSection[nameof(AllowInvalid)], out var value))
{
AllowInvalid = value;
}
}
// For testing