Background We have a number of backend api's that do work; some connect to equipment, some store data, etc. The original setup was each service was a native c# asp.net 6 minimal api running on a windows server 2022. I was able to convince the right people we should be using docker, but as a compromise, I had to write a custom orchestration app to manage each instance and allow for each service to run natively or in a docker container. Kubernetes isn't in the cards. The sell was the devops part with a container registry and simple deployment pipeline, extending that to kubernetes may be too much.
All is good Fast forward, we now have all the apps working and talking to each other and their distribution is configurable. The custom orchestration allows for simple switching between native exe processes and containers, as well as configuring multiple servers to run various instances of these apps. The base image is aspnet:6.0. Deploying updates is a drop down list.
Then came SSL certificates. They are a nightmare so far. I don't have much experience working with them in general, and trying to get two docker containers living on two different servers to use self signed certificates living on the host OSes is troublesome. Mostly passing the certificates to the docker containers (as a client) on creation. Dialing into a docker container from a client side native app works fine, but dialing out from a client side docker container to another docker container doesn't. Unfortunately, the native apps work just fine, so the work in convincing others I had managed is in the toilet for docker if I don't pull something together.
Question Is it best practice to put a reverse proxy server in front of our services regardless of docker and could something like nginx potentially solve my SSL certificate problems?
Note: I'm thinking the custom orchestration app could install and configure a container for an nginx service on startup and I could point all of the containers and native apps at that service for all SSL communication. This would allow us to not worry about encryption and keys on our end but be an implementation detail in production.
Any guidance or thoughts would be appreciated. This is new territory for me.
I added a diagram of what's happening. When I create the containers I'm able to add the cert for the container to use with inbound messages just fine. aspnet:6.0 has environment variables designed to handle that. ASPNETCORE_Kestrel__Certificates__Default__Path
and ASPNETCORE_Kestrel__Certificates__Default__Password.
But those handle the inbound encryption, not accepting a self signed certificate for an outbound message. I don't think the container is getting the installed self signed certificates from the host for use. I suspect I would need to install the client certs in the container somehow. We tried mounting a volume to a directory containing the .pfx files but we keep getting "object not found" from the encryption library. Which seems like a symptom of it not being in the proper certificate store on the machine.