I have a valid SSL certificate with a base64 format key. I have added the certificate using Nginx. but not working. routing is still hitting HTTP, not hitting HTTPS.network team suggest me to add a certificate directly to kestrel.
appsettings.json
"Kestrel": {
"https_port": 443,
"EndPoints": {
"Https": {
"Url": "https://*:7003"
}
}
},
"AllowedHosts": "*"
Try adding this to your appsettings.json
:
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://*:7003",
"Certificate": {
"Path": "path-to-your-pfx-file.pfx",
"Password": "password"
}
}
}
}
See the docs and the ASP.NET Core source code that loads the config.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With