How to add SSL/HTTPS to WAMP ?
Posted by: xxspawn09xx (---.mskcc.org)
Date: March 22, 2019 08:06PM

Hi

I'm running Windows Server 2016

WAMP 3.1.7

Apache 2.4.37

PHP 7.2.14

MySQL 5.7.24

I am able to access h t t p://localhost.

However, when I access h t t p s://localhost, I will get this error ERR_SSL_PROTOCOL_ERROR using Chrome.

I use openssl to generate private.key and certificate.crt and put them under

C:\wamp64\bin\apache\apache2.4.37\conf\key3


I've un-commented these three lines in httpd.conf file

LoadModule ssl_module modules/mod_ssl.so

Include conf/extra/httpd-ssl.conf

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so


I've updated httpd-ssl.conf file


<VirtualHost _default_:443>

# General setup for the virtual host
DocumentRoot "${SRVROOT}/htdocs"
ServerName localhost:443
ServerAdmin admin@example.com
ErrorLog "${SRVROOT}/logs/error.log"
TransferLog "${SRVROOT}/logs/access.log"


SSLCertificateFile "${SRVROOT}/conf/key3/certificate.crt"


SSLCertificateKeyFile "${SRVROOT}/conf/key3/private.key"


I've updated httpd-vhosts.conf

# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
#Require local
Require all granted
#AuthName "Restricted access"
#AuthType Basic
#AuthUserFile "${INSTALL_DIR}/www/admin/.htpasswd"
#require valid-user
</Directory>
</VirtualHost>

<VirtualHost *:443>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
#Require local
Require all granted
#AuthName "Restricted access"
#AuthType Basic
#AuthUserFile "${INSTALL_DIR}/www/admin/.htpasswd"
#require valid-user
</Directory>
</VirtualHost>



Can someone tell me what I am missing to make h t t p s://localhost work ?

Much appreciated

Options: ReplyQuote
Re: How to add SSL/HTTPS to WAMP ?
Posted by: RiggsFolly (Moderator)
Date: March 24, 2019 03:13PM

Did you read this [forum.wampserver.com]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: How to add SSL/HTTPS to WAMP ?
Posted by: xxspawn09xx (---.mskcc.org)
Date: April 08, 2019 07:12PM

Yes, I read the post you wrote. Appreciate that you shared your HOWTO with others. I followed the steps in the post but still got the error ERR_SSL_PROTOCOL_ERROR using Chrome.

Also, in your post, I found

Find
<Directory "c:/Apache2/cgi-bin">
SSLOptions +StdEnvVars
</Directory>

and change to
<Directory "c:/wamp/www/wamphelpers">
SSLOptions +StdEnvVars
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>


Find
SSLSessionCache "shmcb:c:/Apache2/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300

and change it to
SSLSessionCache "shmcb:c:/wamp/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
Find
<Directory "c:/Apache2/cgi-bin">
SSLOptions +StdEnvVars
</Directory>

and change to
CustomLog "c:/wamp/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"


You changed

<Directory "c:/Apache2/cgi-bin">
SSLOptions +StdEnvVars
</Directory>

twice ?

Options: ReplyQuote
Re: How to add SSL/HTTPS to WAMP ?
Posted by: Otomatic (Moderator)
Date: April 08, 2019 09:17PM

Hi,

In this thread [forum.wampserver.com] you have an example of a fully functional httpd-ssl.conf file.

In your httpd-vhosts.conf file do not mix the "normal" VirtualHost on port 80 with the VirtualHost https on port 443.
Reserve, as in the example above, the VirtualHost port 443 for the file httpd-ssl.conf.

It also seems that you failed to tell Apache to listen on port 443. The listening request (Listen 443) is also in the example.

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.