How do I create a self signed SSL certificate for an Apache Server to use while testing a web app?
When using the SSL for non-production applications or other experiments you can use a self-signed SSL certificate. Though the certificate implements full encryption, visitors to your site will see a browser warning indicating that the certificate should not be trusted.
How do I create a self-signed SSL Certificate for testing purposes?
from http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#selfcert:
Make sure OpenSSL is installed and in your PATH.
Run the following command, to create server.key and server.crt files:
openssl req -new -x509 -nodes -out server.crt -keyout server.key
These can be used as follows in your httpd.conf file:
SSLCertificateFile /path/to/this/server.crt SSLCertificateKeyFile /path/to/this/server.key
It is important that you are aware that this server.key does not have any passphrase. To add a passphrase to the key, you should run the following command, and enter & verify the passphrase as requested.
openssl rsa -des3 -in server.key -out server.key.new mv server.key.new server.key
Please backup the server.key file, and the passphrase you entered, in a secure location.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With