wamp – A Weblog of Priyank Maniar https://priyank.rocks Articles on web development & mobile app development Sun, 17 Jun 2018 14:30:24 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 How to setup https on local machine? https://priyank.rocks/how-to-setup-https-on-local-machine/ Wed, 28 Mar 2018 07:06:00 +0000 http://priyank.rocks/?p=111 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: https://www.proy.info/how-to-enable-localhost-https-on-wamp-server/

I used answer of alexkb at https://stackoverflow.com/questions/2355568/create-a-openssl-certificate-on-windows 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 https://social.dev.com then you also need to setup in etc/hosts for social.dev.com without https. So one entry in hosts file for http and one for https.

ServerName dev.com
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

]]>