- 環境
- Red Hat Enterprise Linux Server release 7.7 (Maipo)
- curl 7.29.0 (x86_64-redhat-linux-gnu)
事象 : httpsをcurl
したら怒られた
$ curl https://localhost
curl: (60) Issuer certificate is invalid.
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.
原因 : SSLで証明書の検証に問題があるから
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).
(訳)このHTTPSサーバーが、バンドルに示されているCAによって署名された証明書を使用する場合、証明書の問題(有効期限が切れているか、名前がURLのドメイン名と一致していない可能性)が原因で証明書の検証に失敗した可能性があります。
対応 : -k
か--insecure
オプションで証明書の検証をしない
If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.
(訳)curlによる証明書の検証をオフにしたい場合は、-k (または--insecure)オプションを使用します。
ちゃんとURL先が見えた
$ curl --insecure https://localhost
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
...省略...
</body></html>