Setting up self-signed ssl certificates
Creating a self signed certificate and configuring apache to use it
Table of Contents
Creating Self Signed Cert & Key
- Path for certs
mkdir /etc/apache2/ssl
- Gen Cert & Key
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ -keyout /etc/apache2/ssl/sslSite.key \ -out /etc/apache2/ssl/sslSite.cert - Assign Right Permissions
chmod 600 /etc/apache2/ssl/*
SSL Apache Site
Site Configuration
- /etc/apache2/sites-enabled/example.conf
ServerAdmin webmaster@localhost ServerName example.com:443 SSLCertificateFile /etc/apache2/ssl/sslSite.key SSLCertificateKeyFile /etc/apache2/ssl/sslSite.cert - Reload Apache2
- service apache2 reload
Check
- openssl s_client -connect example.com:443