I setup a computer that was connected to a building speaker system to act as a PA System. I created a web utility that allowed users to enable and disable the audio if it was required without having to get IT to do it. Now those with all the browser security settings and SSL everywhere I had to add an SSL Certificate to the server.
The Server is running XAMPP on Windows, so we have a couple steps to get this site validated.
- Download our Certificate and Key. In this case the key is on my primary webserver, and the certificate I need to download from digicert.
- Install the certificate. Using the "CMD Prompt" type MMC then add the snap in for certificates, ensure you use the "local computer" and then in the "Trusted Root Certification Authorities" import the SSL Certificate.
Stop Apache, Create a folder in C:\xampp\apache\ called crt
- Create 2 Files, copy the content from the provided links into the new files.
cert.conf https://gist.githubusercontent.com/turtlepod/3b8d8d0eef29de019951aa9d9dcba546/raw/518d3a96b7bb03494ada4f2ebde8325fb6ba6966/cert.conf
and make-cert.bat
https://gist.github.com/turtlepod/e94928cddbfc46cfbaf8c3e5856577d0 - Double click and run the make-cert.bat and create your local certificate, this will make it easier or create a directory with your domain name (pasystem.domain.ca) and copy/paste the cert and the key in there
- Add the following to the xampp conf file located in C:\xampp\apache\conf\extra\httpd-xampp.conf
- And add this code at the bottom:
## site.test
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs"
ServerName pasystem.domain.ca
ServerAlias pasystem.domain.ca
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "C:/xampp/htdocs"
ServerName pasystem.domain.ca
ServerAlias pasystem.domain.ca
SSLEngine on
SSLCertificateFile "crt/pasystem.domain.ca/server.crt"
SSLCertificateKeyFile "crt/pasystem.domain.ca/server.key"
</VirtualHost> - In newer versions of xampp you may need to combine them as shown below
<VirtualHost *:80 *:443>
DocumentRoot "C:/xampp/htdocs"
ServerName pasystem.domain.ca
ServerAlias pasystem.domain.ca
SSLEngine on
SSLCertificateFile "$PATH/crt/pasystem.domain.ca/server.crt"
SSLCertificateKeyFile "$PATH/crt/pasystem.domain.ca/server.key"
</VirtualHost> - After that, you will need to restart Apache in XAMPP.
Reference
https://stackoverflow.com/questions/64800565/how-to-create-valid-ssl-in-localhost-for-xampp
https://shellcreeper.com/how-to-create-valid-ssl-in-localhost-for-xampp/