Setup SSL in Your Local Development Environment with XAMPP

Apr 24, 2011 by     No Comments    Posted under: Tech

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 (remove the # in front of…)
Include /Applications/XAMPP/etc/extra/httpd-ssl.conf

- Save the file (Control-O), 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

- If you created the certificate in your home directory, you could do
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

- Use your XAMPP Control Panel to restart Apache

Got anything to say? Go ahead and leave a comment!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">