Sometime I need to validate SSL certificate from internal network with Curl.
Example:
I wanted to Curl to Google public ip “172.217.194.94” with specific DNS
www.google.co.uk => 172.217.194.94
There are many ways to do it. e.g. fixed hosts file or curl with host header ,but I prefer curl — resolve
$ curl -v --resolve www.google.co.uk:443:172.217.194.94 -sS -o /dev/null --write-out '%{http_code}' https://www.google.co.uk
* Added www.google.co.uk:443:172.217.194.94 to DNS cache
* Rebuilt URL to: https://www.google.co.uk/
* Hostname www.google.co.uk was found in DNS cache
* Trying 172.217.194.94...
* TCP_NODELAY set
* Connected to www.google.co.uk (172.217.194.94) port 443 (#0)
...
...
...
Done.