TODO: rewrite in the future.
To use generated *.pfx
certificate with password in docker-compose on raspberry pi - Kestrel server has been used. Code responsible for using cert in .NET app:
builder.WebHost.ConfigureKestrel(c => c.ConfigureEndpointDefaults(opts =>
{
opts.UseHttps("cert-name.pfx", "password-to-pfx");
}));
- .pfx from .pem certificate and key
openssl pkcs12 -export -in cert.pem -inkey key.pem -out your-certificate.pfx
- dotnet local certs Create self-signed certificate - MS Docs
Useful links:
https://stackoverflow.com/questions/13732826/convert-pem-to-crt-and-key
https://stackoverflow.com/questions/6307886/how-to-create-pfx-file-from-certificate-and-private-key
https://stackoverflow.com/questions/49153782/install-certificate-in-dotnet-core-docker-container