Specifying certificates for HTTPS
Adapt appSettings.json file to specify which certificate to use. Also see https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-7.0.
From certificate file
Example
{
...
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://dpe.davidsystems-test.com:443"
"Certificate": {
"Path": "path to pfx file",
"Password": "password for accessing pfx file"
}
}
}
}
...
}
From certificate store (Windows only)
Example
{
...
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://dpe.davidsystems-test.com:443"
"Certificate": {
"Subject": "<subject; required>",
"Store": "<certificate store; required>",
"Location": "<location; defaults to CurrentUser>",
"AllowInvalid": "<true or false; defaults to false>"
}
}
}
...
}
Example with wildcard certificate
{
...
Kestrel": {
"EndPoints": {
"Https": {
"Url": "https://dpe.davidsystems-test.com:443"
"Certificate": {
"Subject": "*.davidsystems-test.com",
"Store": "My",
"Location": "LocalMachine",
"AllowInvalid": "true"
}
}
}
}
...
}