Skip to main content

How to setup https on local machine?

By March 28, 2018June 17th, 2018No Comments

This got essential after Facebook mandatorily required https as referrer url for facebook login.

This guide I followed entirely and it worked like a charm:

I used answer of alexkb at for creating cert and private key.

The command

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout privatekey.key -out certificate.crt

For setting up virtual host, paste following in httpd-vhosts.conf

say you setup then you also need to setup in etc/hosts for without https. So one entry in hosts file for http and one for https.

DocumentRoot c:/wamp/www/
SSLEngine On
SSLCertificateFile “c:/wamp/bin/apache/apache2.4.23/conf/key/certificate.crt”
SSLCertificateKeyFile “c:/wamp/bin/apache/apache2.4.23/conf/key/private.key”
<Directory “c:/wamp/www/”>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local