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 :
Installing WordPress on Windows PC using WAMP
---
Optionally, you can use a better looking console with Syntax Highlighting
Additionally, download and install Win32 OpenSSL Installer :
1 | http://slproweb.com/products/Win32OpenSSL.html |
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 :
1 | C:wampbinapacheapache2.2.22bin |
So, open console2 or crap looking Command Prompt and change directory (cd) :
1 | cd C:wampbinapacheapache2.2.22bin |
This is where we are :

Run this command :
1 | openssl req -new > webserver.csr |
You have to give some data :

Generate key by running this command :
1 | 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 :
1 | 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 :
1 | C:wampbinapacheapache2.2.22 |
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 :
1 | Include conf/extra/httpd-ssl.conf |
remove the # in front and save it. It was inactive. So from this file we got an important path :
1 | C:wampbinapacheapache2.2.22confextra |
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 :
1 2 3 4 5 6 | <VirtualHost _default_:443> DocumentRoot "c:/wamp/www" ServerName localhost:443 ServerAdmin admin@thecustomizewindows.com ErrorLog "c:/wamp/logs/error.log" TransferLog "c:/wamp/logs/access.log" |
Edit three lines more :
1 2 3 | 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 :
1 | C:wampbinapacheapache2.2.22conf |
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 :
1 | dir = c:/wamp/OpenSSL |
Now cd to C:wamp in your Console2 by :
1 | cd C:wamp |
Create OpenSSL folder :
1 | mkdir OpenSSL |
Go to OpenSSL folder :
1 | cd OpenSSL |
Run one by one :
1 2 3 4 | mkdir certs mkdir crl mkdir newcerts mkdir private |
Like this :

Our Keys are on :
1 | C:wampbinapacheapache2.2.22bin |
These will copied :
1 2 3 | webserver.cert webserver.csr webserver.key |
to :
1 | C:wampOpenSSLcerts |
And these :
.rnd
privkey.pem

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.
