micha / resty

Little command line REST client that you can use in pipelines (bash or zsh).
MIT License
2.65k stars 143 forks source link

resty fails silenty with self-signed certs (-k) #45

Closed eddiewebb closed 6 years ago

eddiewebb commented 10 years ago

I was struggling to understand why resty was silent on all commands, no error, no output.

GET / GET /agents POST /

etc.. just returned immediately. SO I poked with curl and forget the app was self-signed.

curl -L https://mysite.com
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

adding -k to the resty initialize call fixed everything.

THis critical error from curl should be presented to the user when initializing resty.

mkonecny commented 9 years ago

Instead of using -k why not use --cacert and point to your self-signed certificate??

eddiewebb commented 9 years ago

I guess the point is one needs to know the problem (which resty is swallowing) in order to use either argument as a solution

AdrieanKhisbe commented 6 years ago

The next major version will no longer hide curl error when hapenning. cf 4187af8 And It's gonna ship soon :)