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

  • For nonancient curl specifically you don't have to fix your actual name resolution at all, you can just use commandline option --resolve – dave_thompson_085 Jan 10 at 11:06
  • Can you explain why --resolve is helpful in my case? – TicJit Jan 10 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 Jan 10 at 13:17
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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.