今日が一番若い日です!
ネットのこととか

Let’sEncryptでエラーがでたら

記事内に商品プロモーションを含む場合があります

はじめに

無料のSSL証明書が発行できるLet’sEncrypt。

Chromeの話もあって使う人が急増してると思いますが、エラーがでて発行できない!って人も出てきてるんじゃないかと。

ここでは私がだした2つのエラーの対応方法をかいておきます

 

①archive directory exists for

コマンド実行後、「archive directory exists for ドメイン名」とでて発行に至らない場合があります(主に取得をやり直した場合だと思います)。

設定するドメインが1つなら /etc/letsencrypt の下をざっくり消しちゃうという話もあるようですが、たとえば複数ドメインで残りはいじりたくないときなんかは下記フォルダを削除されるといいかと思います

/etc/letsencrypt/live/消したいドメイン名のフォルダ

/etc/letsencrypt/renewal/消したいドメイン名.conf

/etc/letsencrypt/archive/消したいドメイン名のフォルダ

※削除作業は慎重に&自己責任で!

 

原因と対策

もうお気づきかもしれませんが、「archive directory exists for ドメイン名」は上記3つ目の

/etc/letsencrypt/archive/消したいドメイン名のフォルダ

があるから発行できませんよ、っていう意味です。

すなおに”rm -Rf 対象のフォルダ”で消しちゃいましょう。

怖いときはmvでどっか別なフォルダに移しといてもいいかも

 

②too many certificates ~

これも何度か発行をしてると出ると思います。

①は通常色のメッセージなので気づきにくいですが、こっちは数行赤くなるのですぐ気づくかと思います

こんな感じ↓

# certbot certonly –webroot -w /var/www/html/ -d ドメイン名
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for ドメイン名
Using the webroot path /var/www/html for all unmatched domains.
Waiting for verification…
Cleaning up challenges
An unexpected error occurred:
There were too many requests of a given type :: Error creating new cert :: too many certificates already issued for exact set of domains: ドメイン名: see https:/ /letsencrypt.org/docs/rate-limits/
Please see the logfiles in /var/log/letsencrypt for more details.

 

原因と対策

お前作りすぎだよ。もう当分あげない(意訳)

っていうことです。

https://letsencrypt.org/docs/rate-limits/

We also have a Duplicate Certificate limit of 5 certificates per week. A certificate is considered a duplicate of an earlier certificate if they contain the exact same set of hostnames, ignoring capitalization and ordering of hostnames. For instance, if you requested a certificate for the names [www.example.comexample.com], you could request four more certificates for [www.example.comexample.com] during the week. If you changed the set of names by adding [blog.example.com], you would be able to request additional certificates.

同じドメインで発行できるのは1週間で5回だそうです。失敗したら翌週まで待ちましょう

 

まてない場合(apacheとめちゃってサイトが死んでるよ!とか)、以下をお試しください

 

●サブディレクトリ、別ドメインと合わせて発行コマンドをいれると受け付けてくれる

当サイト”3pei.info”は2018年8月17日現在、単独での証明書の再発行ができなくなっています。(だから例文が載せられる。。)

なので別ドメインを包含させて無理やり再発行しています

 

# certbot certonly –webroot -w /var/www/html/ -d 3pei.info -d 3pei.ml

 

無理やりあてがったのは↓で取得した無料ドメイン。

サブディレクトリでやればこれは必要ありません
※ただしいずれにしても名前解決はできるようにしておかないとだめ

 

 

とりあえずこんな感じで。