Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how-to-set-up-ssl-certificate-localhost-xampp/ #3

Open
utterances-bot opened this issue Feb 23, 2024 · 6 comments
Open

how-to-set-up-ssl-certificate-localhost-xampp/ #3

utterances-bot opened this issue Feb 23, 2024 · 6 comments

Comments

@utterances-bot
Copy link

How to Set Up an SSL Certificate in Localhost for XAMPP

Learn step-by-step how to set up a self-signed SSL certificate on localhost using XAMPP, Apache and OpenSSL. You'll be ready in a few minutes. [VIDEO]

https://neutrondev.com/how-to-set-up-ssl-certificate-localhost-xampp/

Copy link

Can I create multiple certificates for multiple projects following this tutorial? It seems like every certificate is unique so it would not be a problem for windows, but the lines below about Xampp/Apache config make me doubt about it working for different projects:

SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"

@Tynael
Copy link
Owner

Tynael commented Feb 23, 2024

@natirivero You'll have to generate a certificate for each project and store the certificates in different folders.

Then, in xampp/apache/conf/extra/httpd-vhosts.conf for every project within the same Apache server, you'll have to specify the correct path for SSLCertificateFile & SSLCertificateKeyFile.

# First Project

<VirtualHost *:<your-port>>
    ServerName <your-domain>
    ServerAlias<your-domain>
    DocumentRoot "C:/xampp/htdocs/first-project/public"
</VirtualHost>

<VirtualHost *:<your-port>>
    ServerName <your-domain>
    ServerAlias <your-domain>
    DocumentRoot "C:/xampp/htdocs/first-project/public"
    SSLEngine on
    SSLCertificateFile "conf/ssl.crt/first-project/server.crt"
    SSLCertificateKeyFile "conf/ssl.key/first-project/server.key"
</VirtualHost>

# Second Project
# Third Project and so on...

Hope this helps 🙌

@natirivero
Copy link

natirivero commented Feb 23, 2024 via email

@Tynael
Copy link
Owner

Tynael commented Feb 24, 2024

I guess I could duplicate the existing ones and rename the copy, then
update httpd-vhosts.conf to look for the new copy, and generate a new cert
with the original files?

Yep

Copy link

Hi @Tynael

I have followed this tutorial and everything was successful. However my site is still showing not secure.

I have changed my port to 8085 and have added it to the vhost.
Do I need to add the port to it when creating the certificate?

I mean the "Common name" part because that seems the part I am not sure of.

@Tynael
Copy link
Owner

Tynael commented Aug 18, 2024

Hey @Highbee4u 👋
You don't have to add the port to the "Common name" field when creating the certificate.
Because the certificate is self-signed, some browsers still show the site as insecure. Have you tried accessing your site through other browsers? A Chrome-based browser (i.e. Google Chrome, Brave, or Edge) should work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants