Install free SSL certificates on AWS EC2 (using "SSL For Free")
Category: Tech Stuff | Last updated: January 15, 2020
Following steps can be used to install SSL certificate on an AWS EC2 instance.
- Install mod_ssl on your EC2 instance.
sudo yum install -y mod24_ssl
- Get SSL certificates for your domain from https://www.sslforfree.com
- You can also use service like https://letsencrypt.org
- Upload the certificate files to following directories on your EC2 instance:
- /etc/pki/tls/private/private.key
- /etc/pki/tls/certs/certificate.crt
- /etc/pki/tls/certs/ca_bundle.crt
- Edit
/etc/httpd/conf.d/ssl.conf
file to use above paths.-
SSLCertificateFile /etc/pki/tls/certs/certificate.crt
SSLCertificateKeyFile /etc/pki/tls/private/private.key
SSLCACertificateFile /etc/pki/tls/certs/ca_bundle.crt
-
Make sure that HTTPS traffic is allowed on your server.
For more details check https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-amazon-linux-ami.html
Note:
Sometimes you might also have to add chain certificate.
In such case, please visit https://whatsmychaincert.com and test whether your server is using correct chain certificate.
If not, then you can generate the chain certificate and upload to /etc/pki/tls/certs/server-chain.crt
.
Make sure to edit /etc/httpd/conf.d/ssl.conf
to use appropriate path of the chain certificate.