【Linux/Error】curl: (60) SSL certificate problem: unable to get local issuer certificateの対処法

この記事からわかること

  • curl: (60) SSL certificate problem: unable to get local issuer certificate対処法
  • エラー原因
  • SSL証明書

index

[open]

\ アプリをリリースしました /

みんなの誕生日

友達や家族の誕生日をメモ!通知も届く-みんなの誕生日-

posted withアプリーチ

Homebrewをインストールしようとした際にエラーが発生してしまったのでその原因と解決方法をまとめていきます。

環境

おすすめ記事:【Mac】PHPのインストール方法!Homebrewの使い方と環境変数の通し方!

curl: (60) SSL certificate problem: unable to get local issuer certificate

Homebrew(ホームブルー)のインストール方法

MacにHomebrewをインストールするためにcurlコマンドを含んだ以下のコマンドを実行した際にエラーが発生しました。

実行コマンド

$ curl /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Error

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

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

エラーの原因

エラーの原因を探るため翻訳してみます。

curl: (60) SSL 証明書の問題: ローカル発行者証明書を取得できません
詳細はこちら: https://curl.haxx.se/docs/sslcerts.html

curl はサーバーの正当性を検証できなかったため、
それに安全な接続を確立します。この状況を詳しく知るために、
修正方法については、上記の Web ページを参照してください。

エラーの原因はSSLの証明書に問題があることがわかりました。

解決方法

SSLの証明書に問題があることがわかったのでcurlコマンドの-kオプションもしくは--insecureを使用してSSL証明書を無視させることで解決できます。

$ curl -k 任意のURL
$ curl --insecure 任意のURL

コマンド確認

$ man curl

  -k, --insecure
        (TLS) By default, every SSL connection curl makes is verified to be secure. This option allows curl to proceed and operate even for server connections otherwise considered insecure.

        The server connection is verified by making sure the server's certificate contains the right name and verifies successfully using the cert store.

        See this online resource for further details:
          https://curl.haxx.se/docs/sslcerts.html

        See also --proxy-insecure and --cacert.

ですがこれは根本的解決にはなっていないので本来なら証明書をインストールするのが良いかもしれません。

まだまだ勉強中ですので間違っている点や至らぬ点がありましたら教えていただけると助かります。

ご覧いただきありがとうございました。

searchbox

スポンサー

ProFile

ame

趣味:読書,プログラミング学習,サイト制作,ブログ

IT嫌いを克服するためにITパスを取得しようと勉強してからサイト制作が趣味に変わりました笑
今はCMSを使わずこのサイトを完全自作でサイト運営中〜

New Article

index