2
votes

i wasn't able to access localhost via https without danger notice & valid https certificate

i searched too many to find a solution to access my localhost using my domain and https , for 7 days , resolving dns, resolving httpd.conf https problems, creating self signed certificates, to do it without any danger notice when visiting it from my domain ..

Error.log was give me these warrnings

[warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)

[warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?

[warn] Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)

My Simple Solution Steps:

1. change ServerName in httpd.conf file

ServerName localhost

with your domain

ServerName example.com

2. change ServerName with your domian in httpd-ssl.conf file too

<VirtualHost _default_:443>
ServerName example.com
ServerAlias www.example.com
DocumentRoot "C:/your/site/files/patch"

3. change ServerName with your domian in httpd-vhost.conf file too like this

<VirtualHost *>
ServerName example.com
ServerAlias www.example.com
DocumentRoot "C:/your/site/files/patch"

4. signup in cloudflare, change your domain nameservers with cloudflare nameservers in your domain provider dns page

5. create cloudflare free ssl certificate & key and save them in the default web server application certificate & key files .. , i am using apache so i saved it in

C:/apache/conf/ssl/server.crt
C:/apache/conf/ssl/server.key

6. restart your web application service and try to visit your domain :)

my lesson tags are: apache | xampp | cloudflare | ssl | dns | localhost | https , but i can't add them all :)

Message to admin: i hope to just mark it as closed or resolved to help people who search for this , thanks to all.

1
You could put your solution steps as your answer, so it follows the SO format and doesn't look like a forum post - Eric Majerus

1 Answers

0
votes

Just Follow The Steps Above :)

i will make an update, to make you able to visit your localhost from the internet using FREE DOMIAN without it cost you 0.01$ :), just up vote me :), THANKS.