I have a .net application using websocket, deployed to AWS EB with a load balancer. I have a domain name and ACM certificate set up, and I would like to enable TLS. In my local server, it is set up like this:
var certificate = X509Certificate2.CreateFromPemFile("Path/To/Pem", "Path/To/Key"); //replace the local file with an ACM certificate
if(certificate != null)
{
var socket = new WebSocketServer($"wss://example.com:3000");
socket.SslConfiguration.ServerCertificate = certificate;
//other configs
}
How to do the same set up with ACM? If I use a third party certificate, and upload that to the ec2 instances, these instances will be replaced by EB because of auto scaling. Is it possible to get a path to the ACM certificates?
EDIT: I need my app to get the certificate from Amazon Certificate Manager, and construct an X509Certificate for my custom websocket listener.