Sample Header Ad - 728x90

Why does curl -k -I https://host.example.com not return response headers if certificate is not valid?

0 votes
1 answer
3210 views
Does anyone know why curl with -k (--insecure) option and -I for show headers still shows the html response and not the headers as expected? Working as expected: $ curl -I https://validsslcert.example.com HTTP/1.1 302 Moved Temporarily Server: Apache-Coyote/1.1 ... $ curl -k -I https://validsslcert.example.com HTTP/1.1 302 Moved Temporarily Server: Apache-Coyote/1.1 ... $ curl -k https://invalidcert.example.com
... NOT working as expected: $ curl -k -I https://invalidcert.example.com


Maintenance

It doesn't really matter here what I'm doing, but I'm testing what headers get set to identify different backend acl logic on haproxy. I would expect curl to allow me to make an insecure connection (invalid certificate) and still return the headers?
Asked by Peter Hubberstey (36 rep)
Jan 11, 2021, 12:20 PM
Last activity: Jul 9, 2025, 02:05 PM