I have tried searching for it online, but I got confused. I didn't get any clarity.
-
Kindly specify the version of wamp in tags. As it is causing confusion to the users. A lot of answers related to this solution are also specific to wamp-2 (not wamp-3) :-) – Asif Mehmood Dec 17 '18 at 05:55
-
See tutorial here https://youtu.be/D5IqDcHyXSQ – Shailesh Ladumor Apr 04 '21 at 09:46
3 Answers
Copied from the link:
Enabling SSL on WAMP
This step by step guide explains how you can enble SSL on WAMP.
Download WampServer 2.0 from here and install it to the default location (c:\wamp).
Now, we need to have a private/public key pair as well as a CA to sign our public key.
First, lets see how we can create a private/public key pair.
keytool -genkey -alias rpcert -keyalg RSA -keysize 1024 -dname "CN=identity-rp,L=SL,S=WS,C=LK" -keypass wso2key -keystore rpkeystore.jks -storepass wso2key
This will create a keystore [rpkeystore.jks] with public/private key pair.
My previous post explains how you can export your private key from the keystore. Just follow the steps given there and you'll end up with a file server.key, which is your private key.
Now, we need to sign our public certificate with a CA.
This - requires us to create a sample CA and following explains how to do that.
Here we use OpenSSL to build the required CA infrastructure. For Windows you can download Win32 OpenSSL v0.9.8g from here.
Once installed make sure you add C:\OpenSSL\bin [i.e [INSTALLED_LOCATION]\bin]
to the PATH env variable.
openssl req -x509 -newkey rsa:1024 -keyout cakey.pem -out cacert.crt
The above will creare a public/private key pair for our sample CA.
Now, we need to create a certificate signing request to our server.
Go to the folder where you created the keystore [rpkeystore.jks] and issue the following command.
keytool -certreq -v -alias rpcert -file csr.pem -keypass wso2key -storepass wso2key -keystore rpkeystore.jks
Now copy the csr.pem to the folder where you generated keys for the CA and issue the following command from there.
openssl x509 -req -days 365 -in csr.pem -CA cacert.crt -CAkey cakey.pem -CAcreateserial -out server.crt
By now we have all the requiured files.
cacert.crt --> CA public certificate server.crt --> Server public certificate signed by the CA server.key --> Server private key.
Copy all the above three files to c:\wamp\bin\apache\apache2.2.8\conf
assuming you installed WAMP to the default location.
Also edit c:\WINDOWS\system32\drivers\etc\hosts file and add the following entry.
127.0.0.1 identity-rp
If you could recall, when we creating the public certificate for our server, we created it for identity-rp.
- Edit httpd.conf [C:\wamp\bin\apache\apache2.2.8\conf]
Uncomment the following two lines.
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
Find Listen 80 and change it to Listen 12081 - that is our server is running on port number 12081.
Find ServerName and set it to ServerName identity-rp:12081.
Edit httpd-ssl.conf [C:\wamp\bin\apache\apache2.2.8\conf\extra]
Set Listen identity-rp:12444 - we are listening to port 12444 for secure communication.
Set
Set DocumentRoot "C:/wamp/www/"
Set ServerName identity-rp:12444
For the entire file find "C:/Program Files/Apache Software Foundation/Apache2.2" and replace with "C:/wamp/bin/apache/apache2.2.8".
Find SSLCertificateFile and set SSLCertificateFile "C:/wamp/bin/apache/apache2.2.8/conf/server.crt"
Find SSLCertificateKeyFile and set SSLCertificateKeyFile "C:/wamp/bin/apache/apache2.2.8/conf/server.key"
Find SSLCACertificateFile and set SSLCACertificateFile "C:/wamp/bin/apache/apache2.2.8/conf/cacert.crt"
- Edit php.ini (C:\wamp\bin\apache\apache2.2.8\bin)
Uncomment the line extension=php_openssl.dll
Now we are done - do a syntax check and start the apache server.
:> cd C:\wamp\bin\apache\apache2.2.8\bin :> httpd -t :> httpd --start
Type
https://identity-rp:12444
on your browser - you'll see a certificate error at the brower - to avoid it install CA certificate in your browser.

- 28,090
- 2
- 45
- 53

- 2,928
- 2
- 21
- 28
-
-
2mine ain't too bad to read (shameless plug) http://www.phpjoel.com/2011/04/07/installing-ssl-using-openssl-on-a-wamp-localhost/ – J_B Feb 29 '12 at 06:23
-
1
-
1Marked down because of references to scripts on other sites and commands like "keytool" with no detail of what "keytool" is or where to get it. – PrestonDocks May 12 '16 at 22:49
-
@ddsultan for me that results in `'keytool' is not recognized as an internal or external command, operable program or batch file.` – Mike Feb 14 '17 at 12:42
-
-
-
before trying this solution, i want to make sure that does it work for *wamp-3* – Asif Mehmood Feb 27 '18 at 01:19
-
already 10 years old, complex way. you can update answer per other answers which has easier steps. – T.Todua Oct 15 '18 at 17:14
The easy way for local host SSL / HTTPS communication (NOTE: THIS IS UNSAFE FOR EVERYTHING EXCEPT LOCAL HOST ON TRUSTED NETWORK):
Go save the following as c:/wamp/bin/php/php5.5.12/cacert.pem
or another path of your choosing (you'll need to remember the path for the next bit)
-----BEGIN CERTIFICATE-----
MIIDBzCCAe+gAwIBAgIJAMoCZ6uI7u4zMA0GCSqGSIb3DQEBBQUAMBoxGDAWBgNV
BAMMD3d3dy5leGFtcGxlLmNvbTAeFw0xOTA4MTIxMzM4MTBaFw0yOTA4MDkxMzM4
MTBaMBoxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEB
BQADggEPADCCAQoCggEBAK3y7R7lAlBHhoPLx2zvfv/mjSy1clk0HAaSgGDSpl6R
Qs5WrIesS3hkfEoRrWkZOx2/B6bqPbrSsoGRwFrG5Qd5P5OXGZTS51xy9z/9raa7
sDH++z7UF6MvF0oATjGOjpIEtmMZMd+oePGghGrilNxE7sJBd8Y5tyMyhf2azk2B
euRJoerhOot8QRkSYqqsUcfOp7K18LGmPKPUkc6guJsv/86GfXZrkQIudlkyvDsk
sIXIj5wvJbZIDizF4NytyuGgIJxTlRmtAgwmcq8UXdnHBZjNyvCZ7ADO+LlvEvRn
fSuDWYKs5MCcgUZkBUB2f3Quc6pCGULuK2nr+VPY0asCAwEAAaNQME4wHQYDVR0O
BBYEFBTtO54yB99DIK0n2GBVJzKvLkY8MB8GA1UdIwQYMBaAFBTtO54yB99DIK0n
2GBVJzKvLkY8MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKr+ZBse
u+df6AG7qCm5NqmvxDVNloqLLIv8mQpUZrIuoWcpmFdXGcMKkpQD7B+mqxVaIfii
JGuc+tuYCcc5n4M2SBawVsLeYK4y79QU+SHYdb2z5Fk105/T/p6SV6aK4lqxvnPL
OQaOO+WHS3alITPk3tDRHJ68iR6KndXecl0hPTe7Y7e74/f94DCAeVK/QyKwkbOS
3pdA0f+AlGiTRaNjc3PFJRgNeUsvwGt0aP+MgimFSLyLpyZiXbux7OCOpKnjeWtO
B3i3in9rnNg2ArpFKQ30bojddEN87bVORJmqgX92oEpS02e1/f72w538oD+F84Uc
lKxvjPlcgIuU+sY=
-----END CERTIFICATE-----
In php.ini
* un-comment and change:
curl.cainfo = "c:/wamp/bin/php/php5.5.12/cacert.pem"
- You can find where your
php.ini
file is on your machine by runningphp --ini
in your CLI or creating a phpinfo file and loading it in browser - I placed my cacert.pem in the same directory as php.ini for ease.
curl.cainfo =
should be set to wherever you saved your own cacert.pem

- 624
- 9
- 16
-
2
-
1
-
2This is nothing to do with the question, which was about enabling an SSL *server*. Your answer affects which CAs the curl *client* will accept as valid, and downloading such an important file from some random code repo is certainly not recommended. – miken32 Dec 16 '18 at 19:01
-
WAMP isn't a server, it's a local environment. There's a great answer above about setting up a cert specifically for WAMP but my answer caters for people who don't need to go through all that. I agree with the security concern so I'll get around to updating the answer asap. – Lewis Jan 03 '19 at 11:05
Simple solution:
The tutorials before 2018 are old and huge... However, todays, you just need simple things:
- Loading 2 Apache modules.
- Generating certificate
- Adding certificate in Virtual-Hosts file.
(You may find this article quite helpful).

- 53,146
- 19
- 236
- 237
-
This post was easy to follow. I had some error while doing your tute. https://articlebin.michaelmilette.com/how-to-add-ssl-https-to-wampserver/ – CodeMonkey Jan 28 '19 at 17:05
-
1Worked for me. For setting up for virtual hosts, I used instructions from this too (step 5 to be specific) https://gist.github.com/muthuishere/c1ed5a59f92809b1b3d7ae293e52102b – Maneesh MK Apr 19 '20 at 12:04
-
Thanks for your contribution. Your suggestion is be helpful, but reads more like a Comment, or a link-only answer, than a complete, self-contained Answer, as per SO guidelines. Please consider updating with details on how to execute your suggestion. Links are fine, but relevant info must also be embedded into your post, so it is valid even if the info on that page changes or the link becomes unavailable. Link-only & incomplete answers discouraged, and might be subject to removal. Link-only answers can also have an unintended side effect of trending SO toward link-generation over knowledge. – SherylHohman Jun 04 '20 at 20:21
-
Worked on wampserver 3.5.2. Just needed to enable two modules in httpd.conf `mod_socache_shmcb.so` and `mod_ssl.so` – Odys Sep 12 '22 at 18:56