Connect on-premise – SSL – Convert .pfx to .pem format
Connect can be configured with Stunnel to support HTTPS and RTMPS. Stunnel requires you to provide a private key and a public cert file in .pem format.
You probably run Stunnel as a service (you should) so you also need to save the private key without a passphrase.
If you have a .pfx file with your private key and public certificate, you need to extract the key and cert from the .pfx file and save them to individual .pem files.
Here’s how to do just that:
- Install OpenSSL from here: https://www.openssl.org/related/binaries.html
- Open a command line window and change to the directory where you installed OpenSSL, i.e. c:\OpenSLL-Win64\bin\.
- Run the following command to extract the private key and save it to a new file:
openssl pkcs12 -in yourpfxfile.pfx -nocerts -out privatekey.pem -nodes
- Now run the following command to also extract the public cert and save it to a new file:
openssl pkcs12 -in yourpfxfile.pfx -nokeys -out publiccert.pem -nodes
- Now you can use the files in your Stunnel config.
You can find more on configuring SSL and a sample config for Stunnel here: