HTTPS in WAMP Server on Windows PC localhost with OpenSSL is quite easy to setup if you follow our step by step guide. You will get self signed certificate. Before setting up HTTPS in WAMP Server, if you have doubt or questions about HTTPS or SSL or OpenSSL, please do a search on the search box in the top of this webpage.
HTTPS in WAMP Server on Windows PC localhost : Needed Setup
For this guide to setup HTTPS in WAMP Server on Windows PC localhost with OpenSSL, you essentially need to follow the setup like us as we described in :
Additionally, download and install Win32 OpenSSL Installer :
HTTPS in WAMP Server on Windows PC localhost with OpenSSL
Basically we need to activate mod_ssl module of Apache. With WAMP, you can simply click on Windows Taskbar arrow menu and LEFT click to invoke the menu in this way :
When you will hover over Apache modules, you will get ssl module option in a long list. Click to tick mark it. You need to go to Apache2’s bin folder, which normally should be in :
So, open console2 or crap looking Command Prompt and change directory (cd) :
This is where we are :
Run this command :
openssl req -new > webserver.csr
You have to give some data :
Generate key by running this command :
openssl rsa -in privkey.pem -out webserver.key
In Ubuntu there is some output, in Windows there is only one sentence as output. Probably due to simulated environment. Next one is a big command :
openssl x509 -in webserver.csr -out webserver.cert -req -signkey webserver.key -days 365
Restart all services of WAMP. Your Apache httpd configuration file (httpd.conf) should be in, it will be invisible but other files will show :
You can open the httpd.conf file from WAMP menu, look at the first screen shot, there is an option named httpd.conf , clicking it will open as text file. There will be a line :
remove the # in front and save it. It was inactive. So from this file we got an important path :
There will be – httpd-ssl.conf
The easy way to edit it in Windows is, using Gedit text editor for Windows. Just open Gedit and drag and drop this file. Your first work is to edit the VirtualHost to real values, like :
<VirtualHost _default_:443> DocumentRoot "c:/wamp/www" ServerName localhost:443 ServerAdmin email@example.com ErrorLog "c:/wamp/logs/error.log" TransferLog "c:/wamp/logs/access.log"
Edit three lines more :
SSLCertificateFile "C:/wamp/OpenSSL/certs/webserver.cert" SSLCertificateKeyFile "C:/wamp/OpenSSL/certs/webserver.key" SSLCARevocationPath "C:/wamp/OpenSSL/crl"
These are not located in this way, they are several lines apart. There is no folder named OpenSSL under wamp folder. Still. Still because we will create it.
There is another file named openssl.cnf in :
Open that in Gedit in the same way. These will not open in Windows normally. In this file there will be a line saying the default location of “dir = ” change it to :
dir = c:/wamp/OpenSSL
Now cd to C:wamp in your Console2 by :
Create OpenSSL folder :
Go to OpenSSL folder :
Run one by one :
mkdir certs mkdir crl mkdir newcerts mkdir private
Like this :
Our Keys are on :
These will copied :
webserver.cert webserver.csr webserver.key
And these :
php.ini is usually rightly configured. There is no need check it unless there is error. Open https url of your localhost. You might need to restart wamp, restart Windows to make it working.