22
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

curl: (60) Issuer certificate is invalid.となった時の対応方法

Posted at
  • 環境
    • 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>

ほかの対応 : 証明書を用意する

22
8
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?