Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A walk through for me, on how to configure a server with SSL using RapidSSL and stunnel

Generate .csr and .key file

openssl req -new -newkey rsa:2048 -nodes -keyout -out

Ensure the "common name" is the host you want to assign the certificate to (in my case it was

Paste the contents of the .csr file in to the .csr field in Follow the authorisation emails from RapidSSL

Create the .crt file by combining the web server certificate and the imtermediate CA from RapidSSL (I've used cat), so the file looks like this:


Save this with the extension .crt.

Create the .pem file by adding the .key file to the top of the .crt file:

cat >
cat >>

Add both files to the stunnel config:


pid = /

accept  = 443
connect = 9000

Restart stunnel

/etc/init.d/stunnel4 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment