LoginSignup
11
1

More than 1 year has passed since last update.

【AWS/EC2/Amazon Linux2】curl: (60) SSL certificate problem: certificate has expired

Last updated at Posted at 2021-11-04

背景

AWS EC2(Amazon Linux2)上で、最新のGoogle Chromeをダウンロードしようと
下記Curlコマンドを実行しました。

sudo curl https://intoli.com/install-google-chrome.sh | bash

すると、タイトルにも記載したエラーが出ました。

curl: (60) SSL certificate problem: certificate has expired
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.

原因

私の場合、Let's Encrypt クロス署名 DST ルート CA X3 の期限切れが原因でした。

解決策

AWSの公式ドキュメント見てたら、解決策ありました。
さすが、AWS公式。

下記コマンドを入力して手動修復をすれば、無事Curlコマンドが通るようになりました。
ご自身のEC2のOSに応じて、使用してみてください。

sudo yum update ca-certificates

リポジトリの GUID がロックされた AMI が使用している場合

Elastic Beanstalk など、リポジトリの GUID がロックされた AMI が使用されている場合は、次のコマンドを使用して、更新された CA 証明書パッケージをインストールできます。

Amazon Linux1

sudo yum install https://cdn.amazonlinux.com/patch/ca-certificates-update-2021-09-30/ca-certificates-2018.2.22-65.1.24.amzn1.noarch.rpm

Amazon Linux2

sudo yum install https://cdn.amazonlinux.com/patch/ca-certificates-update-2021-09-30/ca-certificates-2021.2.50-72.amzn2.0.1.noarch.rpm

同じエラーで困っている方の助けになれば幸いです。
やはり、困った時にまず頼るべきは公式ですね。

11
1
0

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
11
1