Skip to content

Instantly share code, notes, and snippets.

@kevincantu
Created May 11, 2021 00:49
Show Gist options
  • Save kevincantu/37081a6b1c2b816ce1a5eae852e07243 to your computer and use it in GitHub Desktop.
Save kevincantu/37081a6b1c2b816ce1a5eae852e07243 to your computer and use it in GitHub Desktop.
# specify the URL like usual, but point that DNS entry at a different server either by IP or by alt. domain
# https://daniel.haxx.se/blog/2018/04/05/curl-another-host/
#
curl --resolve example.test:443:127.0.0.1 https://example.test/
curl --connect-to example.test:443:alt.test:443 https://example.test/
curl --connect-to example.test:443:alt.test:443 https://example.test/ --header "Host: alt2.test"
# and for TLS certificate checking:
openssl s_client -servername example.test -connect alt.test:443 2>/dev/null </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -text -noout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment