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.1.7 32bit & 64bit)
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 6.3.10>

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 MySQL 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.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.8 32 bit - Apache 2.4.39 - PHP 7.3.4/7.2.17/7.1.28/7.0.33/5.6.40 - MySQL 5.7.25 - MariaDB 10.3.14
Wampserver 3.1.8 64 bit - Apache 2.4.39 - PHP 7.3.4/7.2.17/7.1.28/7.0.33/5.6.40 - MySQL 5.7.25/8.0.15 - MariaDB 10.3.14
PhPMyadmin 4.8.5 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote


Sorry, only registered users may post in this forum.