1

I have a wildcard valid certificate signed by Certificate Authority. Is it possible to test the https locally from the server without a registered DNS?

My idea is to bind the domain name with 127.0.0.1 in /etc/hosts.

The HTML is running on Nginx container and I am using centos 7.

Is it possible to make an SSL handshake with curl https://<dnsname>.<name>.com:443 or it needs to be public DNS?

Note: ICMP is disabled but the server is connected to internet

3
  • For nonancient curl specifically you don't have to fix your actual name resolution at all, you can just use commandline option --resolve Commented Jan 10, 2020 at 11:06
  • Can you explain why --resolve is helpful in my case?
    – TicJit
    Commented Jan 10, 2020 at 13:14
  • After a seach I can use curl http://www.example.com --resolve www.example.com:443:127.0.0.1 without binding example.com in /etc/hosts right?
    – TicJit
    Commented Jan 10, 2020 at 13:17

1 Answer 1

3

For validating the certificate it is relevant that the domain in the URL matches the certificate. The certificate itself can be provided from any IP address, i.e. it does not have to be the public visible IP address but can also be a local one like 127.0.0.1. The mapping of domain to IP address is usually done by DNS but can also be done with a local hosts file, i.e. /etc/hosts in Linux.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .