How to Synchronize an SSL Certificate Between Two Servers

ssl-certificate

I have two servers behind a router and a domain name with a wildcard certificate. (*.example.com) The certificate is from Let's Encrypt and is managed by Server A. (Uses IIS on Windows 10.)
The other server B uses Ubuntu 20 with Apache2.
Server A looks at port 80 and 443. Server B looks at port 8080 and 8443 and is just for testing purposes. Port forwarding on my router will send incoming requests to the proper server.
But because of this setup, I am unable to request a Let's Encrypt certificate with server B. And why would I, as server A already has the wildcard certificate that I can use. So all I need is some simple automated process that can copy the certificate from A to B so both servers share the same certificate. Makes sense?
I'm not looking for port forwarding as both servers use the same domain name (and similar subdomains) so there's no use for that. I'm also not looking for a manual solution as this needs to be automated in an easy way. The systems are used as development environment for applications and sites that I develop and the reason for sharing the certificate is to simply allow outside testers to do a complete test of what I make, no matter if it runs on IIS/Windows or Apache2/Linux.

Best Answer

LetsEncrypt has the ability to run a post install script after renewing a cert, just write a script to copy it from one to the other and kick the web server to reload the certs