I have a x.example
which serves traffic for both a.example
and b.example
.
x.example
has certificates for both a.exa
The selected answer helped me find the answer, even though it does not contain the answer. The answer in the mail/archive link Patrick Mevzek provided has the wrong port number. So even following that answer will cause it to continue to fail.
I used this container to run a debugging server to inspect the requests. I highly suggest anyone debugging this kind of issue do the same.
Here is how to address the OP's question.
# Instead of this:
# curl --header 'Host: a.example' https://x.example
# Do:
host=a.example
target=x.example
ip=$(dig +short $target | head -n1)
curl -sv --resolve $host:443:$ip https://$host
If you want to ignore bad certificates matches, use -svk
instead of -sv
curl -svk --resolve $host:443:$ip https://$host
Note: Since you are using https, you must use 443
in the --resolve
argument instead of 80
as was stated on the mail/archive