I'm trying to use curl
to get the HTTP status of a GET request:
curl --insecure --silent --show-error --connect-timeout 1 -I https://host:8443/health
Note: I'm using the --insecure
flag in this command.
I get the following output:
HTTP/1.1 403 Forbidden
Server: Apache-Coyote/1.1
Pragma: No-cache
Cache-Control: no-cache
Accept-Ranges: bytes
Last-Modified: Wed, 16 May 2012 03:05:24 GMT
Content-Type: text/html
Content-Length: 1234
Date: Wed, 16 May 2012 08:57:30 GMT
When I navigate to this URL in a browser, it works fine and I get a 200 OK
.
How can get a 200 OK
from the curl command? Can I export the PEM cert from the browser and use it some way?
Best Answer
You can export the cert from your browser and use it with cURL. From the man page :