Quick steps to configure SSL encryption on a WAMP server

There are a number of guides for this on the web, all of varying accuracy. These are the minimal steps I followed to get it working for development on a stock WAMP server installation:

  1. Enable ssl_module in the Apache module list
  2. Create the self-signed certificate keys as per Section 3 of http://tud.at/programm/apache-ssl-win32-howto.php3:
    cd c:\path\to\wamp\bin\apache\Apache2.2.11\conf
     
    # Set a PEM passphrase of 4 characters or more.  You can leave the challenge password blank.
    openssl req -config openssl.cnf -new -out my-server.csr
     
    # Set the "Common Name" to localhost, accepting the rest of the defaults.
    openssl rsa -in privkey.pem -out my-server.key
     
    openssl x509 -in my-server.csr -out my-server.cert -req -signkey my-server.key -days 365
  3. In your conf/extra/httpd-vhosts.conf, add this:
    ### SSL
    # see http://www.modssl.org/docs/2.8/ssl_reference.html for more info
     
    # change this from "sem" to avoid startup errors
    SSLMutex default
     
    SSLRandomSeed startup builtin
    SSLSessionCache none
     
    Listen 443
    <VirtualHost *:443>
    ErrorLog logs/ssl.log
    LogLevel info
    # You can later change "info" to "warn" if everything is OK
     
    SSLEngine On
    SSLCertificateFile conf/my-server.cert
    SSLCertificateKeyFile conf/my-server.key
     
    # copy the <Directory> information from the appropriate HTTP virtual host
    DocumentRoot "C:/path/to/docroot"
    <Directory />
        ...
    </Directory>
    </VirtualHost>
  4. Restart Apache.

That should do it, then just navigate to http://localhost:443. You’ll get browser warnings complaining that the certificate is self-signed and thus probably bogus, but it will work otherwise.

Leave a comment

Your email address will not be published. Required fields are marked *