How to Enable Localhost HTTPS (SSL) on WAMP Server (3.0.9)

How to install localhost https url on WAMP server 800x300 - How to Enable Localhost HTTPS (SSL) on WAMP Server (3.0.9)

Throughout my web development career, I have worked on different projects some are big, some are small. Sometimes I have to work on web servers (production servers) that come with SSL enabled to use the HTTPS protocols and whereas my local development machines use HTTP, and this makes my development system different from the production one. But as a developer, I am sure that every developer always like to have an exact environment like the production system. By default, we can’t use HTTPS for our WAMP connections. So here is the step-by-step tutorial on how I installed a self-signed SSL certificate on my local WAMP server to use HTTPS communication.

Step 1: Download and Install WAMP(Windows machine)

Download & install WAMP (Assuming that WAMP is installed, in my case, it’s on G:/ drive, I did it because I prefer to separate my projects from other files )

Step 2: Download OpenSSL

Download OpenSSL – Shining Light Productions choose the appropriate version according to your Operating system. I used “Win64OpenSSL-1_1_0g.exe“. While installing I have selected the default (C:\OpenSSL-Win64) installation folder.

Step 3: Create SSL Key and Certificate

Now we will generate a private key which is 2048bits encryption. “private.key” will be our key file. So to do that we need open the command-prompt and “Run as Administrator”. Go to the installed OpenSSL bin folder.


Once we are in the “bin” directory (Where the OpenSSL installed) type the following command. You will prompt to enter a pass-phrase (password) and also ask to verify the phrase, just enter any password(e.g. “localhost”) you like.

openssl genrsa -aes256 -out private.key 2048

Now we will remove the pass phrase from the RSA private key. We will also take a backup copy of the original file. It’ll ask you the passphrase that was entered on the previous command, so just type it.

copy private.key private.key.backup
openssl rsa -in private.key.backup -out private.key

Now we will generate a self-signed certificate, which will be used to certify the connection for encrypted traffic. “certificate.crt” will be our certificate. This is a single line command.

openssl req -new -x509 -sha1 -key private.key -out certificate.crt -days 36500 -config C:\OpenSSL-Win64\bin\openssl.cfg

Once we are done, 2 files will be generated(private.key and certificate.crt) in “C:\OpenSSL-Win64\bin

Step 4: Copy the Created SSL Key and Certificate file

Now, create a folder “key“at: “G:\wamp\bin\apache\apache2.4.23\conf\key” and copy “private.key” and “certificate.crt” to “key” folder.

Step 5: Open httpd.conf, php.ini & uncomment

Open “httpd.conf” in a text editor, located at “G:\wamp\bin\apache\apache2.4.23\conf\httpd.conf“. uncomment these lines by removing # at the beginning of the line, than save the file.

LoadModule ssl_module modules/
Include conf/extra/httpd-ssl.conf
LoadModule socache_shmcb_module modules/

Open “php.ini” in a text editor located at “G:\wamp\bin\php\php5.6.25\php.ini“. Check if this is uncommented.


Step 6: Open httpd-ssl.conf and make the final changes

Open “G:\wamp\bin\apache\apache2.4.23\conf\extra\httpd-ssl.conf“, Find “<VirtualHost _default_:443>” and below that line find and update below configuration according to your setup. Pay attention to the path, I ve created a folder “ssl” inside “G:/wamp/bin/apache/apache2.4.23/logs”

  1. Change “SessionCache….” → SSLSessionCache “shmcb:G:/wamp/bin/apache/apache2.4.23/logs/ssl/ssl_scache(512000)”
  2. Change “DocumentRoot …” → DocumentRoot “G:/wamp/www
  3. Change “ServerName…” → ServerName “localhost:443
  4. Change “ErrorLog….” → Errorlog “G:/wamp/bin/apache/apache2.4.23/logs/ssl/error.log
  5. Change “TransferLog ….” → TransferLog “G:/wamp/bin/apache/apache2.4.23/logs/ssl/access.log
  6. Change “SSLCertificateFile ….” → SSLCertificateFile “G:/wamp/bin/apache/apache2.4.23/conf/key/certificate.crt
  7. Change “SSLCertificateKeyFile ….” → SSLCertificateKeyFile “G:/wamp/bin/apache/apache2.4.23/conf/key/private.key
  8. On the same file replace ‘<Directory “c:/Apache24/cgi-bin”>‘ with ‘<Directory “G:/wamp/www”>’
  9. On the same file Change “CustomLog….” → CustomLog “G:/wamp/bin/apache/apache2.4.23/logs/ssl/ssl_request.log

Step 7: Copy PHP DDL files to windows

Copy ssleay32.dll & libeay32.dll from “G:\wamp\bin\php\php7.0.10” folder to “C:\windows\system32“.

Now restart all the services in WAMP server and try to load https://localhost/

Step 8: Test to make sure it works!

Now go back to command prompt window, from the G:\wamp\bin\apache\apache2.4.23\bin  type the following and check if you are getting Syntax is OK

httpd –t


About This Author

My name is Parameshwar Roy (P. Roy), and I am a web developer. This is my personal blog to record my own thoughts. Though I am not a natural writer, I love to share my experiences. Hope my experiences will be useful to more about me


You can post comments in this post.

  • Great article, very much appreciated. Just curious, when I test the actual localhost, should I still get the messages in the browser that the site is not secure or add an exception for the site? I believe this may be the default settings in the browsers that I am using; firefox, edge, and chrome.

    James 9 months ago Reply

  • C:\wamp64\bin\apache\apache2.4.23\bin>httpd -t
    httpd: Syntax error on line 184 of C:/wamp64/bin/apache/apache2.4.23/conf/httpd.
    conf: Cannot load modules/ into server: O sistema operacional n\xe3o p
    ode executar %1.

    i have this problem

    luis cachinho 9 months ago Reply

    • same problem to me.

      selno 4 months ago Reply

      • Parameshwar Roy Proy 150x150 - How to Enable Localhost HTTPS (SSL) on WAMP Server (3.0.9)

        Try it now

        P. Roy 4 months ago Reply

        • Not working same error
          .\httpd.exe -t

          httpd.exe: Syntax error on line 174 of C:/wamp/bin/apache/apache2.4.17/conf/httpd.conf: Cannot load modules/ into server: The operating system cannot run %1.

          Chris 3 months ago Reply

  • Hi, thank you, it works great! You have one small mistake: “serer.key” -> “server.key” 🙂

    Vaclav Cernik 9 months ago Reply

  • Great tutorial – worked perfectly. Saved me a lot of time. Big and many thanks!

    Small remark:
    In Step 2 it turns out that Google’s OpenSSL is too old for my WAMP with Apache 2.4.23.
    However, using Shining Light Productions’ build Win64 OpenSSL v1.0.2L worked just fine.
    (I did not use the latest Win64 OpenSSL v1.1.0f Light because Stack Overflow article cannot-load-modules-mod-ssl-so-into-server advised against it.)

    Thank you again,

    Bogdan 8 months ago Reply

  • Awesome man, thank you so much. Works great on Windows 10. Only thing I needed to change in each snippet of code was my directory, which is “C:” and change “wamp” to “wamp64” since I was using that version.

    For anyone else coming here, everything went as smooth as butter, except for one tiny thing. When I was going through http.conf and making the changes Proy suggested, when I did a search for the line, “LoadModule socache_shmcb_module modules/”, the text editor said it couldn’t find it. It’s definitely in there, so don’t let that distract you.

    Daniel Zuzevich 8 months ago Reply

  • this work for me thanx buddy…….

    chamara 8 months ago Reply

  • Hi, there’s no openssl.cnf file when I downloaded OpenSSL. And also it is an exe file, not zip file.
    And I think because of that I got error “Can’t open config file: /usr/local/ssl/openssl.cnf”

    Dandy 7 months ago Reply

    • Hello, install openSSL.exe and OpenSSL-Win64\bin , copy openssl.cfg and rename to openssl.cnf.

      Asish 6 months ago Reply

  • in step 8
    i had this error :
    httpd: Syntax error on line 184 of D:/wamp64/bin/apache/apache2.4.23/conf/httpd.conf: Cannot load modules/ into server: Le syst\xe8me d\x92exploitation ne peut pas ex\xe9cuter %1.

    ouldfella 7 months ago Reply

  • Hi, could you please tell me one thing, if i configured like your way.
    then all my projects will run on ssl way like that i done my project without ssl:

    Then those will run with https://localhost/abc, https://localhost/def etc like that?

    kh ashique 7 months ago Reply

    • Parameshwar Roy Proy 150x150 - How to Enable Localhost HTTPS (SSL) on WAMP Server (3.0.9)

      I’ve made some changes. Try it now.

      P. Roy 4 months ago Reply

  • Hello,
    everything is working perfect on localhost. Initially in faced issue while accessing it on another ip.I configured vhosts.conf as below to make it work.

    # Virtual Hosts

    ServerName localhost
    DocumentRoot c:/wamp64/www

    Options +Indexes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted

    I can access http://myip on local LAN, but when i access https://myip , i’m getting following error:
    You don’t have permission to access / on this server.
    Apache/2.4.27 (Win64) OpenSSL/1.1.0f PHP/5.6.31 Server at Port 443 ”

    Thanks in advance!

    Asish 6 months ago Reply

    • Fixed: edit httpd-ssl.conf as below @ line number 256.

      SSLOptions +StdEnvVars

      #Options FollowSymLinks
      Options +Indexes +Includes +FollowSymLinks +MultiViews
      AllowOverride All
      Require all granted

      Asish 6 months ago Reply

      • thank you thank you thank you!!! I had the same problem, and your solution worked! thanks for sharing

        astrid 4 weeks ago Reply

  • Super, Super, Super… Really helpful my dear friend

    Anand Raju 6 months ago Reply

  • The procedure is great, but something went wrong on windows 10. Plus I had to use 1.0.2 SSL as another user did. When I try to restart my services the apache service will not start. There are not any errors logged either. I think it might have something to do with the port conflict.

    Tom Lee 6 months ago Reply

  • Hi Proy, good tutorial.

    So, I´m facing a problem here, after all the steps, I get an error where the mod_ssl cannot be loaded:
    “Cannot load modules/ into server: %1 is not a valid Win32 application.”. At first I thought the problem was the Openssl version I got, which was the one you listed from google (x64). After trying the version WIN32 only said that the module couldn´t be loaded. I tried downloading the versions on Shining Light but also the same problem. Now when I start the Wamp server, the localhost is refusing all the requests.
    Any idea on where I can check?

    Gustavo Marrara 6 months ago Reply

    • Further looking for a solution here, seems that the DLL files were not working and any of the ones I was finding online. Decided the pull them from the PHP 7 folder and now it´s working 🙂
      thanks again for the tutorial

      Gustavo Marrara 6 months ago Reply

      • Parameshwar Roy Proy 150x150 - How to Enable Localhost HTTPS (SSL) on WAMP Server (3.0.9)

        I’ve made some changes. Try it now.

        P. Roy 4 months ago Reply

  • Followed everything, but I am getting an error in my ssl error log :

    [Tue Oct 24 11:52:30.957450 2017] [ssl:emerg] [pid 1420:tid 632] AH02577: Init: SSLPassPhraseDialog builtin is not supported on Win32 (key file C:/wamp64/bin/apache/apache2.4.27/conf/sslkeycert/server.crt)

    [Tue Oct 24 11:52:30.957450 2017] [ssl:emerg] [pid 1420:tid 632] AH02564: Failed to configure encrypted (?) private key localhost:443:0, check C:/wamp64/bin/apache/apache2.4.27/conf/sslkeycert/server.crt

    [Tue Oct 24 11:52:30.957450 2017] [ssl:emerg] [pid 1420:tid 632] SSL Library Error: error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag

    Using the 64bit wamp , 64bit Google openssl files, and double checked everything was followed. Ideas?

    SM 6 months ago Reply

    • Parameshwar Roy Proy 150x150 - How to Enable Localhost HTTPS (SSL) on WAMP Server (3.0.9)

      I’ve made some changes. Try it now.

      P. Roy 4 months ago Reply

      • You also have to comment the following line into httpd-ssl.conf : SSLPassPhraseDialog builtin
        => #SSLPassPhraseDialog builtin

        tekool 1 month ago Reply

  • I downloaded OpenSSL from Shining Light, which is an exe installer, not a zip file. I installed it in the default location (“C:\OpenSSL-Win64”). My WAMP64 (v3.1.0) already contains all the files listed in Step 3. Do I still have to copy/paste those files from the OpenSSL package to Wamp?
    There is no ssleay32.dll in the OpenSSL package.

    Gilbert 5 months ago Reply

  • Thanks. But the problem is that I get error 403 forbidden by accessing https://localhost !
    What is the problem?

    Pooria 5 months ago Reply

  • Thanks, the tutorial worked perfectly!

    Ivan 5 months ago Reply

  • Awesome article thanks for share this article

    Shipom 4 months ago Reply

  • Great article I have followed the steps bu i got following error

    SSLCertificateFile: file ‘C:/wamp64/bin/apache/apache2.4.23/conf/Key/certiicate.
    crt’ does not exist or is empty

    Php learner 4 months ago Reply

    • I have copied the certificate file and key file to the key folder..

      Php learner 4 months ago Reply

  • I got this error after running httpd -t
    “AH00526: Syntax error on line 52 of C:/wamp64/bin/apache/apache2.4.27/conf/extra/httpd-ssl.conf:
    Invalid command ‘SSLCipherSuite’, perhaps misspelled or defined by a module not included in the server configuration”

    karthick 3 months ago Reply

  • Hi,
    After doing all the step I am trying to restart my wamp, but, its stauck on the orange color.
    Do you have any idea why?
    Thank a lot.

    Kja Ja 3 months ago Reply

    • Parameshwar Roy Proy 150x150 - How to Enable Localhost HTTPS (SSL) on WAMP Server (3.0.9)

      I think you need to review the steps.

      P. Roy 3 months ago Reply

  • I Have done all the step but each browser says its is not secure there is red in chrome, not secure on mozilla.. please guide me


    Ghufran 2 months ago Reply

    • Parameshwar Roy Proy 150x150 - How to Enable Localhost HTTPS (SSL) on WAMP Server (3.0.9)

      Warning will still be there. You need to add it to exception to access the page.

      P. Roy 2 months ago Reply

  • Hi, thank you, thank you and thank you! It works.
    I have tried several another guides, but none works for me. This one works.
    Only add notic about browser warning – its ok on localhost 🙂
    Thank you.

    Michal Tiller 1 month ago Reply

  • Just wanted to say thanks! You made it so easy for even someone of my skill level to set this up on his machine. Kudos!!! (And your step 8 really made it possible to identify what was going wrong and get the green Wampserver icon back on my statusbar!)

    Sreeram 1 month ago Reply

  • Hi, gr8 tutorial…

    I have one question, for me is already running well in my localhost, I’ve downloaded the last open-ssl version and do the steps above in the tutorial, all is patient to configure the files. I’ll made an Spanish video tutorial to my YouTube channel if you concede me the rights ha-ha always given to you the credits.

    Well, this the question about…I running some “VirtualHost” in wamp, so when I running for example “” this show me the page where I have to click on advance and add the exception but the button “Add Exception…” doesn’t appear…What can I’ll do in this case? can you help me please?

    Thanks in advance, and again gr8 tutorial…

    Jashirou 2 weeks ago Reply

  • Awesome!
    Work Smooth also won wamp64 (windows 64 version)

    Guy 1 week ago Reply

Leave A Reply