Install SSL on windows localhost WAMP HTTP & SSL HTTPS

This tutorial will demonstrate how to install SSL certificate in Windows localhost WAMP server.
Install SSL on windows localhost WAMP HTTP & SSL HTTPS

Lot many times our production servers are installed with SSL certificates and our local development machines uses normal http, and this makes our development system different from our production one. And as a developer we always like to have an exact environment like our production system.

If you are not able to convert WAMP server icon to green, you can check this video.

So here’s the guide how to install self signed SSL certificate on the local WAMP installation and use Https communication with your local WAMP.

Resources used in tutorial:

File with all commands Download

Here are the things we are going to do

  1. Download & install WAMP (Assuming that WAMP is installed in C: drive)
  2. Download & install OpenSSL
  3. Configure WAMP to use HTTP + SSL = HTTPS

If you want to run multiple WordPress installations on single server with sub-domain, you can check this video on Apache 2 sub domain mapping.

Watch the video tutorial to know about the detailed step by step procedure.

Ste by step process for making HTTPS enabled WAMP | HTTP+SSL=HTTPS

Step 1:

Download & install WAMP (Assuming that WAMP is installed in C: drive)

Step 2:

Download & install OpenSSL

Step 3:

Configure WAMP to use HTTP+SSL=HTTPS

Step 4:

Step 5:

CMD in Path to openssl.exe :::


Now copy the privateKey & certificate into folder

Step 6:

Open httpd.conf & uncomment following


Open php.ini (wampbinphpphp5.5.12php.ini)

Step 7:

Edit C:/wamp/bin/apache/apache x.x.x/conf/extra/httpd-ssl.conf

Step 8

Now check the syntax of file using below command.

Want to buy me a beer?

[wpedon id=2805]

Help others by sharing the content!

16 thoughts on “Install SSL on windows localhost WAMP HTTP & SSL HTTPS”

  1. Hi. I would like some help regarding this ssl cert for academic purpose. I followed everything in your tutorial but when I execute the step: httpd -t (in cmd), I got an error and cannot open the localhost with https. The error is as below:

    [core:warn] [pid 5040:tid 196] AH00111: Config variable ${SRVROOT} is not defined

    I’ve been working on this one problem for days and still can’t seem to solve it. Could you help me with this problem? Thank you.

    Reply
    • Step: 1
      You need to Define the variable SRVROOT in httpd.conf file.


      You can refer to this question on how to define variable in httpd.conf file:
      https://stackoverflow.com/questions/6569080/how-to-define-a-variable-in-apaches-httpd-conf-file

      Reply
  2. Thanks for the tutorial. Is ‘localhost’ a FQDN? I also develop sites on localhost and update my HOSTS file so the domain is resolves at my IP (e.g. 127.0.0.1 MYDOMAIN.COM), will these SSL instructions work for instances like this too?

    Reply
  3. Hello once I enter genrsa -aes256 -out private.key 2048 it won’t let me type anything and if i bypass to the next cmd i get errors

    Reply
    • That’s normal because you are using self signed certificate. When you install on your production server, you will need to use ca verified certificate, which will not give any warning.
      there is no way you can use verified certificate on localhost.

      Reply
  4. I Follow all instructions till the end but in the last my wamp server could not run.
    Kindly help me to solve this error.
    In the log file showing this error:

    [Wed Feb 05 12:47:23.406487 2020] [ssl:emerg] [pid 4108:tid 420] AH02564: Failed to configure encrypted (?) private key localhost:443:0, check C:/wamp64/bin/apache/apache2.4.41/conf/Key/certificate.crt
    [Wed Feb 05 12:47:23.406487 2020] [ssl:emerg] [pid 4108:tid 420] SSL Library Error: error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag
    [Wed Feb 05 12:47:23.406487 2020] [ssl:emerg] [pid 4108:tid 420] SSL Library Error: error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error
    [Wed Feb 05 12:47:23.406487 2020] [ssl:emerg] [pid 4108:tid 420] SSL Library Error: error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag
    [Wed Feb 05 12:47:23.406487 2020] [ssl:emerg] [pid 4108:tid 420] SSL Library Error: error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error (Type=RSAPrivateKey)
    [Wed Feb 05 12:47:23.406487 2020] [ssl:emerg] [pid 4108:tid 420] SSL Library Error: error:04093004:rsa routines:old_rsa_priv_decode:RSA lib
    [Wed Feb 05 12:47:23.406487 2020] [ssl:emerg] [pid 4108:tid 420] SSL Library Error: error:0D0680A8:asn1 encoding routines:asn1_check_tlen:wrong tag
    [Wed Feb 05 12:47:23.406487 2020] [ssl:emerg] [pid 4108:tid 420] SSL Library Error: error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error (Type=PKCS8_PRIV_KEY_INFO)

    Kindly reply as soon as possible.

    Reply
  5. (OS 3)The system cannot find the path specified. : AH02297: Cannot access directory ‘C:/wamp/bin/apache/apache2.4.41/logs/’ for log file ‘C:/wamp/bin/apache/apache2.4.41/logs/ssl_access.log’ defined at C:/WebServer/bin/apache/apache2.4.41/conf/extra/httpd-ssl.conf:288
    AH00014: Configuration check failed

    i need help

    Reply
  6. I followed your steps, but when I try to start the wamp server it fails with an error 1, and in the Windows Event logs, shows ‘illegal function’.

    My server is a Win 2019 server running Wamp64/Apache2.4.46/SQL/Python… Apache was working fine serving content on port 80 before I tried to enable SSL/Https…

    Httpd-t says no syntax errors.

    1) I see a lot of noise about FQDN versus localhost when creating the certificate. What is the reality here? Do I need the name of the machine, the DNS name, localhost or …?
    2) Is there a way to debug this process? The Apache server doesn’t launch so its logs aren’t updated and the windows system logs are useless. Any ideas?

    Thanks!

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.