- Setup local SSL
Author’s note
This post was recovered from my old blog via the Wayback Machine. This particular post is the only thing I could recover from 2011.
@jbnunn
25-Sept 2022
Setup SSL in your local development environment with XAMPP - Mar 24 2011
Need SSL for you dev work? I constantly found myself needing a “fake” SSL certificate for local development so my local setup could match my remote setups. Here’s how to do it with XAMPP on a Mac.
Drop into Terminal, and generate a private key:
openssl genrsa -des3 -out server.key 1024
Generate the CSR and fill out the form (note, don’t worry about a challenge password (the 8th question)
openssl req -new -key server.key -out server.csr
Configure SSL in httpd.conf for Apache:
cd /Applications/XAMPP/etc
sudo nano httpd.conf
Search for “# Secure (SSL/TLS) connections” (line 480), uncomment
Include /Applications/XAMPP/etc/extra/httpd-ssl.conf
Save the file, open /Applications/XAMPP/etc/extra/httpd-ssl.conf
sudo nano /Applications/XAMPP/etc/extra/httpd-ssl.conf
Edit the path to your certificate file created above. Around line 99 look for
SSLCertificateFile /Applications/XAMPP/etc/ssl.crt/server.crt
Make sure to place the server.crt file in the XAMPP/etc/ssl.crt directory.
sudo cp ~/server.crt /Applications/XAMPP/etc/ssl.crt/server.crt
Do the same for your “SSLCertificateKeyFile” (line 107)
sudo cp ~/server.key /Applications/XAMPP/etc/ssl.crt/server.key
Done. Use your XAMPP Control Panel to restart Apache and you’ll have SSL working locally
- @jbnunn