I'd like to use my Mac OS X with https for local development tests.
How can I easily make Apache2 respond to ssl, just for test proposes – I don't want a real certificate, just a fake to make local https work
How to Create and Configure SSL Certificate in Apache2 on macOS
apache-http-serverhttpsmacmacosssl
Best Answer
For local development testing a self-signed certificate is adequate. You can generate one with the OpenSSL kit like so:
Generating the private key:
output:
enter a passphrase for your private key.
Generating the CSR (certificate signing request):
it will request details like this:
it's fairly straightforward, the common name is your server's hostname as it says in brackets.
Generating the self signed certificate:
Configuring SSL in httpd.conf for Apache:
(replace path appropriately with the path to your certificate and key)
Restart Apache:
Apache will ask you for the passphrase to your key. If you think you will be shutting the server down a lot, you may want to remove the passphrase from the key so you can avoid entering it each time. If not, don't worry about it. If so, complete this step after step 2 (Generating the CSR):