How to set up SSL on Wampserver?
Posted by: codeslayer2010 (---.res.spectrum.com)
Date: June 27, 2023 05:05PM

What are the steps to install SSL on Wampserver? I have been trying for weeks and was able to get "localhost" to be HTTPS, but none of the Apache virtual hosts work. They just forward to localhost instead of their respective local WordPress installs. Whenever I type https://[some.local.virtual.host] it just loops back to the Wampserver default gray background localhost page. I'm fairly certain I have something configured incorrectly, but I'm not sure what.


For reference, these are steps I have already tried that got me the results above:

Installing HTTPS/SSL on Localhost (Justin Stolpe): [www.youtube.com]

STEPS:


1: INSTALL OPENSSL

- While justin says to download and install OpenSSL, I noticed that it already comes packaged with Wampserver 3.3.1, so I just used that

2: CREATE PRIVATE KEY

- OPEN CMD as admin
- CD to C:\wamp64\bin\apache\apache2.4.54.2\bin\openssl.exe

- In CMD run command:

openssl genrsa -aes256 -out private.key 2048

- Enter and verify whatever passphrase you choose

- NOW, private.key is in the bin folder

- RUN this command (Justin didn't explain why):

openssl ras -in private.key

- Enter pass phrase you chose in the create key step

- Now private key is written

3: CREATE SSL CERTIFICATE

- In CMD run command:

openssl req -new x509 -nodes -sha1 -key private.key -out certificate.crt -days 36500

- NOW FILL IN DATA: Only thing that matters is Common Name: it needs to say `localhost` if you are trying to install the cert on your localhost
- IS EMAIL address necessary? Not sure

4: MAKE A PLACE FOR THE KEY AND CERT TO LIVE

- Create a folder named `key` in:

c:\wamp64\bin\apache\apache[version]\conf

- Move private.key and certificate.crt into key folder

- NOW they have been successfully moved to our wampserver

5: EDIT APACHE CONFIG

- EDIT c:\wamp64\bin\apache\apache[version]\conf\httpd.conf

- UNCOMMENT mod_ssl.so line
- UNCOMMENT httpd-ssl.conf line
- UNCOMMENT mod_socache_shmcb.so

6: EDIT APACHE SSL CONFIG

- EDIT c:\wamp64\bin\apache\apache[version]\conf\extra\httpd-ssl.conf

- Make sure DocumentRoot is "c:/wamp64/www"

- ServerName should be localhost or localhost:80 or however you normally type your localhost
- In my case, I just use plain vanilla `localhost`

- UNCOMMENT SSLCertificateFile "${SRVROOT}/conf/key/certificate.crt
- UNCOMMENT SSLCertificateFile "${SRVROOT}/conf/key/private.key

7: RESTART all wamp services


8: LAUNCH LOCALHOST IN WEB BROWSER

- Launched `[localhost]` in Chrome

- Accept security risk warning

- NOW you should be seeing your website homepage!

Eric "CodeSlayer" Hepperle, Web Developer & WAMPServer enthusiast
[erichepperle.com]
[github.com]
[stackoverflow.com]

Options: ReplyQuote
Re: How to set up SSL on Wampserver?
Posted by: Otomatic (Moderator)
Date: June 28, 2023 08:54AM

Hi,

See item "- 7 - Using https with SSL in local VirtualHost" of
Note :Wampserver 3 - Some explanations

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: How to set up SSL on Wampserver?
Posted by: DaveG (89.37.93.---)
Date: July 25, 2023 12:00AM

Hi,

I followed the same process as above and checked the tutorial on item 7.

For some reason I just can't get https working on localhost. I'm running wamp64 3.3.0 on Win11
Is the above still current for this version using:

Apache 2.4.54.2
MySQL 8.0.31
PHP 8.0.26

Totally lost, have tried also a number of different sites guides if google "Wamp64 localhost https", basically all the same as above, and after about 10 tries I'm at a total lose
PS - Uninstalled everything between tries.

Options: ReplyQuote
Re: How to set up SSL on Wampserver?
Posted by: Otomatic (Moderator)
Date: July 25, 2023 08:41AM

Hi,

> For some reason I just can't get https working on localhost.

The procedure does not allow you to set SSL and https on localhost.
Only SSL and https on all local VirtualHosts other than localhost.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: How to set up SSL on Wampserver?
Posted by: GSP (103.130.204.---)
Date: August 28, 2023 05:53PM

We did SSL setup as above

If we access [localhost] getting error as ‘Not secure – Your connection to this site is not secure’

Please help

Thanks



Edited 1 time(s). Last edit at 08/28/2023 05:58PM by GSP.

Options: ReplyQuote
Re: How to set up SSL on Wampserver?
Posted by: Otomatic (Moderator)
Date: August 28, 2023 06:52PM

> If we access 'https://localhost/' getting error as ‘Not secure – Your connection to this site is not secure’

I can only repeat what I have already written here:

The procedure does not allow you to set SSL and https on localhost.
Only SSL and https on all local VirtualHosts other than localhost

However, with a self-signed certificate, you'll get this message in all browsers.
To authorize the self-signed certificate, you need to override it.

With Firefox, for example, you need to click on the Advanced... button, then Accept risk and proceed.

With Chrome, click on Advanced settings then Continue to the site.

With Opera, Help me understand then Continue to the site

Browser developers need to understand that a local connection to a local site, from a local IP, can only be used for development purposes, and that they should just issue a small warning without pulling out the Kalashnikov.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.