HTTPProxy TLS #4537
-
With a httpproxy similar to the example basic-httpproxy.yaml, the following curl command completes successfully When TLS is enabled for a virtual host, I see the request redirected to the secure interface with a 301 redirect, but I am not sure how to get the curl command to succeed for that virtual host. I am using a similar HTTPProxy example as in What is the expected output of curl command above? % curl -i --header "Host: https-example.foo.com" http://localhost/ % curl -i --header "Host: https-example.foo.com" http://localhost:443/ % curl -i --header "Host: https-example.foo.com" https://localhost/ The httpproxy is valid |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When connecting with You probably know this but just for completeness: You also need to provide trusted CA certificate |
Beta Was this translation helpful? Give feedback.
When connecting with
curl https://localhost/
curl will set TLS SNI to hostname tolocalhost
while Envoy is expectinghttps-example.foo.com
. You can trycurl --resolve https-example.foo.com:443:127.0.0.1 https:///https-example.foo.com
to make curl use the correct hostname. I think this would remove also the need to explicitly set theHost
header.You probably know this but just for completeness: You also need to provide trusted CA certificate
curl --cacert trusted-ca.pem
and the server certificate should be issued for the FQDN by having eitherCN=https-example.foo.com
or Subject Alternative Name / SAN set asDNS:https-example.foo.com
. Otherwisecurl --insecure
could be used as a temporary w…