tag:crieit.net,2005:https://crieit.net/tags/letsencrypt/feed 「letsencrypt」の記事 - Crieit Crieitでタグ「letsencrypt」に投稿された最近の記事 2020-02-04T14:36:45+09:00 https://crieit.net/tags/letsencrypt/feed tag:crieit.net,2005:PublicArticle/15708 2020-02-04T14:05:06+09:00 2020-02-04T14:36:45+09:00 https://crieit.net/posts/Update-your-client-software-to-continue-using-Let-s-Encrypt "Update your client software to continue using Let's Encrypt" <p>Let's Encryptからそんなメールが来たあなた、さてはサーバソフトウェアの更新をサボっていますね?ぼくもです😀</p> <p>これが来た人が何をしないといけないのかをまとめました。簡単に言うと certbot を更新しましょう</p> <h1 id="何言われてるの?"><a href="#%E4%BD%95%E8%A8%80%E3%82%8F%E3%82%8C%E3%81%A6%E3%82%8B%E3%81%AE%EF%BC%9F">何言われてるの?</a></h1> <blockquote> <p>According to our records, the software client you're using to get Let's<br /> Encrypt TLS/SSL certificates issued or renewed at least one HTTPS certificate<br /> in the past two weeks using the ACMEv1 protocol. Your client's IP address was:</p> <p><strong><em>.</em></strong>.<strong><em>.</em></strong></p> </blockquote> <p>ここ二週間の記録によると、Let's Encrypt TLS/SSL 証明書を取るために使っているクライアント、ACMEv1 プロトコルを使ってるようです。IPアドレスはこれ</p> <blockquote> <p>Beginning June 1, 2020, we will stop allowing new domains to validate using<br /> the ACMEv1 protocol.<br /> You should upgrade to an ACMEv2 compatible client before then, or certificate issuance will fail. For most people, simply upgrading to the latest version of your existing client will suffice.</p> </blockquote> <p>2020/01/01から、ACMEv1プロトコルでのドメイン認証は停止されます。<br /> ACMEv2を使うクライアントソフトウェアに移行しないと、証明書が更新できなくなります。大多数の人にとっては、単に使っているクライアントソフトウェアを更新すればよいはずです。</p> <p>(訳注 それ以外の人についての説明があるけど、そんな人はこの記事読まないので中略)</p> <blockquote> <p>ACMEv1 API deprecation details can be found in our community forum:<br /> <a target="_blank" rel="nofollow noopener" href="https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1">https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1</a></p> </blockquote> <p>ACMEv1 APIの廃止についての詳細はコミュニティフォーラムで見ることが出来ます。<br /> <a target="_blank" rel="nofollow noopener" href="https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1">https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1</a><br /> (訳注 廃止の進め方の話題なので、ぼくらが何をするかの説明は載ってないぽい)</p> <h1 id="どうすりゃいいの?"><a href="#%E3%81%A9%E3%81%86%E3%81%99%E3%82%8A%E3%82%83%E3%81%84%E3%81%84%E3%81%AE%EF%BC%9F">どうすりゃいいの?</a></h1> <p>certbotを更新すればOKです。</p> <p>ぼくの使っているCentOSだと</p> <pre><code>$ sudo yum update certbot : ================================================================================================= Package Arch Version ================================================================================================= Updating: certbot noarch 1.0.0-1.el7 python-requests noarch 2.6.0-8.el7_7 : Updating : certbot-1.0.0-1.el7.noarch Complete! </code></pre> <p>という感じでした。</p> <p>certbotには<a target="_blank" rel="nofollow noopener" href="https://qiita.com/mogya/items/f43334fd531888c4774f">自動更新のためのtimerがついている</a>ので、これを使っている人は念の為リロードしておきましょう</p> <pre><code>$ sudo systemctl daemon-reload </code></pre> <p>自分でcrontab書いた人は自前でなんとかしてね。せっかくcertbotがtimerを用意してくれているので、こっちを使うことをおすすめするよ。</p> <h1 id="動作確認"><a href="#%E5%8B%95%E4%BD%9C%E7%A2%BA%E8%AA%8D">動作確認</a></h1> <p>一回手動で動かしておけばいいかなと。</p> <pre><code>$ sudo systemctl start certbot-renew $ sudo systemctl status certbot-renew * certbot-renew.service - This service automatically renews any certbot certificates found Loaded: loaded (/usr/lib/systemd/system/certbot-renew.service; static; vendor preset: disabled) Active: inactive (dead) since Tue 2020-02-04 13:06:36 JST; Process: 27876 ExecStart=/usr/bin/certbot renew ... Main PID: 27876 (code=exited, status=0/SUCCESS) Feb 04 13:06:36 linode10.mogya.com certbot[27876]: Processing /etc/letsencrypt/renewal/oasis.mogya.com.conf Feb 04 13:06:36 linode10.mogya.com certbot[27876]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Feb 04 13:06:36 linode10.mogya.com certbot[27876]: Cert not yet due for renewalbot-renew.timer Feb 04 13:06:36 linode10.mogya.com certbot[27876]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Feb 04 13:06:36 linode10.mogya.com certbot[27876]: The following certs are not due for renewal yet: Feb 04 13:06:36 linode10.mogya.com certbot[27876]: /etc/letsencrypt/live/oasis.mogya.com/fullchain.pem expires on 2020-04-09 (skipped) Feb 04 13:06:36 linode10.mogya.com certbot[27876]: No renewals were attempted. Feb 04 13:06:36 linode10.mogya.com certbot[27876]: No hooks were run. Feb 04 13:06:36 linode10.mogya.com certbot[27876]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Feb 04 13:06:36 linode10.mogya.com systemd[1]: Started This service automatically renews any certbot certificates found. </code></pre> <p>こんな感じで、"Cert not yet"(期限がまだだから更新しなかったよ)的なログが出れば大丈夫かと思います。</p> <p>心配な人は、expires on の日付にリマインダを仕掛けておいて動作確認しましょう</p> <h1 id="その他"><a href="#%E3%81%9D%E3%81%AE%E4%BB%96">その他</a></h1> <p> たまにルータなんかが勝手にLet's Encrypt にアクセスして証明書をとってくる仕組みになっているものがあるらしいです。<br /> 自分で証明書を取得した記憶がないのにこのメールを受け取った人は、この記事の対象じゃないので、ルータメーカーのサポートに相談するのがいいんじゃないかと思います。</p> daisuke furukawa tag:crieit.net,2005:PublicArticle/14571 2018-10-19T18:29:16+09:00 2018-10-28T16:39:41+09:00 https://crieit.net/posts/web-docker-letsencrypt-swagger-Flutter 少人数で高速でスマホとwebサービスを立ち上げたかったらdocker、letsencrypt、swagger、Flutter <p><a href="https://crieit.now.sh/upload_images/f8505be55adf1353d8ca75270cef66c55bc9a271c44d9.png" target="_blank" rel="nofollow noopener"><img src="https://crieit.now.sh/upload_images/f8505be55adf1353d8ca75270cef66c55bc9a271c44d9.png?mw=700" alt="DSLF.png" /></a></p> <h1 id="概要"><a href="#%E6%A6%82%E8%A6%81">概要</a></h1> <p>スマホアプリを作る場合、API用のサーバ立ててスマホアプリのクライアントからRESTでジャラジャラ繋ぐと思うんだけど、サーバ側の構築にコストかけられない。<br /> ドメイン取ってコードをデプロイしたらさっとAPIサーバくらいは立って欲しいと思う。その場合、DockerでさっとSSL化自動で証明書取得されると素敵じゃないですか。</p> <h2 id="Docker"><a href="#Docker">Docker</a></h2> <p>それならばdockerイメージでいいのがあったので、使い倒しましょう。</p> <pre><code>jwilder/nginx-proxy </code></pre> <pre><code>jrcs/letsencrypt-nginx-proxy-companion </code></pre> <p>上のDockerイメージをdocker-compose.ymlに記述して、docker-compose up -dを実行するだけで、let's Encryptによる自動SSL化機能のついたletsencrypt-nginx-proxy-companionと、nginx-proxyが立ち上がります。</p> <pre><code>nginx-proxy/docker-compose.yml version: '2' services: nginx-proxy: image: jwilder/nginx-proxy container_name: nginx-proxy ports: - 80:80 - 443:443 volumes: - ./certs:/etc/nginx/certs:ro - /etc/nginx/vhost.d - /usr/share/nginx/html - /var/run/docker.sock:/tmp/docker.sock:ro restart: always letsencrypt-nginx-proxy-companion: image: jrcs/letsencrypt-nginx-proxy-companion container_name: nginx-letsencrypt volumes: - ./certs:/etc/nginx/certs - /var/run/docker.sock:/var/run/docker.sock:ro volumes_from: - nginx-proxy restart: always </code></pre> <p>参考URL: <a target="_blank" rel="nofollow noopener" href="https://qiita.com/pipinosuke/items/e35368711c845b04fde7">Dockerで簡単にマルチドメインかつSSL証明(自動更新) nginx-proxyとLetsEncrypt</a></p> <h2 id="Swagger"><a href="#Swagger">Swagger</a></h2> <p>API側はSwaggerでサクッと作ります。</p> <p>Swagger Editorを使ってswagger.yml(swagger.jsonでも可)を書けば、モックとして起動もできるし、サーバー側、クライアント側それぞれの言語でのソースも自動生成できる。最終的には、APIドキュメントも生成できるので、一度yaml、またはjsonを作って仕舞えば、同じAPI設計のアプリを量産できる優れもの。</p> <h2 id="Flutter"><a href="#Flutter">Flutter</a></h2> <p>問題はアプリ側、こちらはさっと作る手段がまだなくてせいぜいFlutterでAndroidとiOSを同時にビルドするくらいなもの。</p> <p>もう少し検証と実践を積んだら記事にします。</p> <h1 id="結論"><a href="#%E7%B5%90%E8%AB%96">結論</a></h1> <p>じゃんじゃんアプリとWebを作って世の中の技術向上に貢献しましょう!</p> <h1 id="補足"><a href="#%E8%A3%9C%E8%B6%B3">補足</a></h1> <p>私の<a target="_blank" rel="nofollow noopener" href="https://www.kichij.org/">Wordpress</a>も、上記のDocker、Let's Encryptの環境に移行しました。</p> fk2000