Certificate and private key (SSL)
Posted by: Christiane (---.cable.dynamic.v4.ziggo.nl)
Date: January 26, 2022 09:39PM

Hi Guys,
It concerns a localhost installation of a copy of a production site which uses SSL and a certificate. I wanted to reproduce this environment on my localhost and test a few things before proceeding to the changes on production.
Configuration: Wamp64 server 3.2.6 (PHP 7.4.26 Apache 2.4.51 MySQL 5.7.36) with WP 5.8.3

To test the SSL on my localhost, I did the following:
1. Installed OpenSSL on C:\Program Files\OpenSSL)

2. I executed C:\Program Files\OpenSSL-Win64\bin\opensll as administrator and created a private.key and a certificate.crt files

3. I copied these files into C:\wamp64\bin\apache\apache2.4.51\conf\key
Note \key is a new sub directory I created.

4. I configured the httpd.conf file by uncommenting the following modules:
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

5. I configured httpd-ssl.conf file
DocumentRoot “c:/wamp64/www/test-devriesjuwelier.nl”
ServerName localhost:443
ServerAdmin admin@example.com
I also added the path of the certicate and private key:
SSLCertificateKeyFile “${SRVROOT}/conf/key/private.key”
SSLCertificateFile “${SRVROOT}/conf/key/certificate.crt”

6. I configured the virtualhost in the http-vhosts.conf
<VirtualHost *:443>
ServerName test-devriesjuwelier.nl
DocumentRoot “c:/wamp64/www/test-devriesjuwelier.nl”
<Directory “c:/wamp64/www/test-devriesjuwelier.nl/”>
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
SSLEngine on
SSLCertificateFile “${SRVROOT}/conf/key/certificate.crt”
SSLCertificateKeyFile “${SRVRoot}/conf/key/private.key”
</VirtualHost>

7. I restarted all services of Wampserver and saw this warning:
“There is a syntax error in Apache conf files. AH00526: Syntax error on line 157 of C:/wamp64/bin/apache/apache2.4.51/conf/extra/httpd-ssl.conf: SSLCertificateKeyFile: file ‘C:/wamp64/bin/apache/apache2.4.51/conf/private.key’ does not exist or is empty

However the file exists. See step 5 above. What strucks me in this message is that the path is not what I gave in http-vhosts.conf file.

8. When I still try to go to [localhost] in my browser (with all previous cookies deleted), I get a ‘ERR_TOO_MANY_REDIRECTS” error.
I
f I look into the log of the apache server, I see this ssl-warning logged in: “… test-devriesjuwelier.nl:443:0 server certificate does NOT include an ID which matches the server name”

This must be something I missed somewhere, and it must be small. Can you help?

Options: ReplyQuote
Re: Certificate and private key (SSL)
Posted by: RiggsFolly (Moderator)
Date: January 26, 2022 09:58PM

Do a search, I have written a How To and so has Otomatic

---------------------------------------------------------------------------------------------
(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: Certificate and private key (SSL)
Posted by: Otomatic (Moderator)
Date: January 27, 2022 09:25AM

Hi,

> I configured the virtualhost in the http-vhosts.conf
It is much better to leave only port 80 in http-vhosts.conf and use http-ssl.conf for port 443.

See Item 7 of [forum.wampserver.com]

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.