#author("2020-03-09T08:06:56+00:00","default:admin","admin")
#author("2023-04-11T05:48:54+00:00","default:admin","admin")
-[[SSL/TLSについてまとめ2018:https://qiita.com/Brutus/items/1015cc01d2e1eb82a526]]

-[[HTTPS入門:https://rms.ne.jp/Introduction_to_https/]]
-[[常時SSL化のする為の資料:https://qiita.com/nightyknite/items/36cc1d4d067def437e04]]

*基礎知識 [#m2747c7b]
-[[SSLの基本を押さえる:https://thinkit.co.jp/free/article/0706/3/6/]]

-[[SSL 上の TCP 通信を行うサーバとクライアントの実装方法:https://www.keicode.com/windows/ssp-ssl-server-client.php]]

-SSLは共通鍵暗号方式と公開鍵暗号方式の両方を使用する
-公開鍵暗号方式は、データ授受に用いる共通鍵のやり取りのみに用いられる
-送信データは共通鍵にて暗号化される

*通信トラフィック [#b6a2852f]
-[[HTTPS: ”S”の代償:https://qiita.com/giwa/items/934d164a6a8f705883b9]]
-[[HTTP(S)とMQTT(S)の消費電流とデータサイズを計測する:https://qiita.com/kopanitsa/items/5333b3f6126cfe3d7495]]
-[[実はHTTPSは速い!次世代プロトコル”HTTP/2″でサイト表示が高速化:https://www.idcf.jp/rentalserver/aossl/basic/response/]]


* [[OpenSSL:http://www.openssl.org/]] [#daaf2922]
-1.0.0 が出ているが、Apacheのconfigure時にエラーが出たりトラブルに遭遇するので、まだ使わない方が良い

** インストール [#i723f2cb]
 # ./config shared -fPIC
 # make
 # make test
 # make install

-上記は64bit版Linuxの場合
-sharedはシェアードライブラリ(共有ライブラリ)を作るという指定

**プログラミング [#ta3fa6c3]
-[[SSL/TLS でアクセスしてみよう (1):http://x68000.q-e-d.net/~68user/net/ssl-1.html]]
-[[SSL/TLS でアクセスしてみよう (2):http://x68000.q-e-d.net/~68user/net/ssl-2.html]]

*動作検証 [#f3494479]
**OpenSSL [#fd2893e8]
-[[openssl コマンドで SSL/TLS バージョンを指定した HTTPS 接続テストを実施する:http://sig9.hatenablog.com/entry/2016/07/03/230000]]

**wget [#y57a0506]


* 証明書 [#ee254476]
-[[オレオレ証明書を使いたがる人を例を用いて説得する:https://qiita.com/Sheile/items/dc91128e8918fc823562]]

-[[無料 SSL 証明書 StartSSL を使う:http://futuremix.org/2009/02/startssl]]
-[[秘密鍵とCSRの確認:http://ameblo.jp/itboy/entry-10339290260.html]] ... ページの中ほど
-[[マルチクラウド環境におけるサーバ証明書の運用 Let's Encrypt/AWS/Azure:https://qiita.com/Brutus/items/911beead0440d35b8063]]

**Root証明書 [#f11a8ecd]
-[[有効期限切れのルート証明書ファイルにより、SSL通信に失敗する際の対処法:https://qiita.com/y-ken/items/dac5ae8ad6bdbb0e0f17]]

-[[DigiCertのroot証明書、中間証明書 ダウンロード:https://rms.ne.jp/sslserver/basis/digicert-root-certificates/]]
--[[DigiCert Trusted Root Authority Certificates:https://www.digicert.com/kb/digicert-root-certificates.htm]] ... ここからダウンロード

-[[CA certificates extracted from Mozilla:https://curl.haxx.se/docs/caextract.html]]

-[[Google roots.pem:https://pki.google.com/roots.pem]] ... 基本的にはこれで十分(但し、Let's Encryptは未対応?)

-[[GeoTrust Root Certificates:https://www.geotrust.com/resources/root-certificates/index.html]]
-[[digicert【マネージドCA】ルート証明書インストール方法:https://knowledge.digicert.com/ja/jp/solution/SO29755.html]]
-[[DST Root CA X3 - IdenTrust:https://www.identrust.com/dst-root-ca-x3]] ... Let's Encryptを使うならこのRoot証明書を使用する

***GoogleのRoot認証局 [#i9b859db]
-[[Google Trust Services:https://pki.goog/]]
--GoogleのRoot証明書のURLは https://pki.goog/roots.pem
---以前のURLは https://pki.google.com/roots.pem ... 現在は使用不可

-[[Google、独自のルート認証局Google Trust Servicesを運用開始:https://rms.ne.jp/digital-certificate-news/googletrustservices]] ... 2017/2/2
--[[The foundation of a more secure web:https://security.googleblog.com/2017/01/the-foundation-of-more-secure-web.html]] ... 2017/1/26
--[[curlによるhttps通信:https://armadillo.atmark-techno.com/forum/armadillo/2162]] ... 2016/8/10

***Root証明書ファイルの有効期限を確認する方法 [#wdccf304]
-任意のルート証明書ファイルの中身を確認
 $ openssl x509 -text -noout -in 確認対象ファイル.pem
-指定ディレクトリ以下のファイルを対象に一括で確認
 $ find  /etc/ssl/certs/*.pem -type f -exec echo "--------------------" \; -exec echo {} \; -exec bash -c "openssl x509 -text -noout -in {} | head" \;

***Linux [#k54f12f6]
-[[ブラウザのルートCA証明書をLinuxへインストールする:https://blue-red.ddo.jp/~ao/wiki/wiki.cgi?page=%A5%D6%A5%E9%A5%A6%A5%B6%A4%CE%A5%EB%A1%BC%A5%C8CA%BE%DA%CC%C0%BD%F1%A4%F2Linux%A4%D8%A5%A4%A5%F3%A5%B9%A5%C8%A1%BC%A5%EB%A4%B9%A4%EB]]

 $ curl https://pki.goog/roots.pem -O
 $ sudo mv roots.pem /etc/pki/ca-trust/source/anchors/
 $ sudo update-ca-trust 

**自己証明書 [#q307cd0f]
-[[SAN(Subject Alternative Name)フィールド を含むSSL証明書を作成する - Windows Server Tips:https://www.ipentec.com/document/windows-server-create-ssl-certification-including-san-dns-name-field]]
-[[「証明機関」による証明書の発行 (サーバー証明書を作成する) - Windows Server Tips:https://www.ipentec.com/document/create-server-certificate-file]]

**IoTデバイス用 [#k81ca78e]
-[[GMOグローバルサイン、IoTデバイス向けのSSL証明書大量発行サービスを開始:https://www.atmarkit.co.jp/ait/articles/1705/08/news075.html]]



*[[Let's Encrypt:https://letsencrypt.org/ja/]] [#t19cc79e]
-[[Let's Encrypt 総合ポータル:https://letsencrypt.jp/]] ... 非公式解説サイト
-[[Let's Encrypt ユーザーガイド:https://free-ssl.jp/docs/using.html]]

-[[無料SSL証明書のLet's Encryptとは?:https://ssl.sakura.ad.jp/column/letsencrypt/]]

-[[Let's Encrypt の証明書をブラウザ上で簡単取得 (dns-01 / ECDSA もあるよ):https://qiita.com/tappie/items/76881fdf7996c57a105a]]
-[[IPアドレス制限下でもcertbotの無料SSL証明書を発行してもらう方法:https://qiita.com/AkihiroTakamura/items/06ced4e780dc217bc1aa]]

**Root証明書 [#bc5637e2]
-[[Chain of Trust:https://letsencrypt.org/ja/certificates/]]

-[[DST Root CA X3 - IdenTrust:https://www.identrust.com/dst-root-ca-x3]] ... Let's Encryptを使うならこのRoot証明書を使用する

-[[無料SSL認証サービス「Let’s Encrypt」のルート証明書が全ての端末で信頼されるまで5年はかかりそう:https://gigazine.net/news/20180807-lets-encrypt-root-torasuted/]]

-Let's Encryptでもルート証明書を発行しているが、現段階では多くのルート証明書ストアに採用されていない
--Let's Encryptのルート証明書「ISRG Root X1」は、モダンなブラウザやOSでは既に利用可能となっており、今後は(Iden Trustから)独自のルート証明書へ移行していくことが発表されている
--しかし、古いOSやスマートフォンなどには、このルート証明書が搭載されていないため、現在はIden Trustというルート認証局が運用する「[[DST Root CA X3:https://www.identrust.com/dst-root-ca-x3]]」というルート証明書でクロス署名された中間証明書を利用している
--Iden TrustはISRGのスポンサーでもある

**Windows [#c28f54ca]
-[[IISでhttpsのサイトを作成する - SSLサイトの構成 (Windows Server Tips):https://www.ipentec.com/document/windows-windows-server-iis-setup-https-site]]
-[[win-acme を利用してIISでLet's Encrypt を利用したSSLサイトを作成する (Windows Server Tips):https://www.ipentec.com/document/software-iis-ssl-certificate-using-win-acme]]
-[[IISでLet's Encrypt を利用してSSLサイトを構築する (letsencrypt-win-simple クライアントを利用) (Windows Server 操作方法 Tips):https://www.ipentec.com/document/software-iis-ssl-certificate-using-lets-encrypt]]
-[[Let’s EncryptでIIS上にSSLサイトを導入する方法:https://webbibouroku.com/Blog/Article/letsencrypt-setting]]
-[[独自ドメインでDDNS運用するWindows Server 2016 EssentialsのSSL/TLS証明書をLet’s Encryptで無料取得/自動更新するように構成した:https://satsumahomeserver.com/blog/299605]]
-[[制限と仕様からLet's Encrypt(ACMEv1)の話:https://qiita.com/sawanoboly/items/8e3c57aa2e30fc58c4e3]]


**ASP.NET Coreの場合 [#bd174033]
-[[Configuring LetsEncrypt for ASP.NET Core and IIS:https://weblog.west-wind.com/posts/2017/Sep/09/Configuring-LetsEncrypt-for-ASPNET-Core-and-IIS]]
-[[Using Let’s encrypt with ASP.NET Core:https://www.softfluent.com/blog/dev/Using-Let-s-encrypt-with-ASP-NET-Core]]

-【DocumentRoot】/web.config の以下の部分をコメントアウトする
 <system.webServer>
     <!--
     <handlers>
       <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
     </handlers>
     -->

-【DocumentRoot】/.well-known/acme-challenge/web.config を配置
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <system.webServer>
     <httpRedirect enabled="false" />
     <validation validateIntegratedModeConfiguration="false" />
     <staticContent>
       <clear />
       <mimeMap fileExtension="." mimeType="text/json" />
       <mimeMap fileExtension=".*" mimeType="text/json" />
     </staticContent>
   </system.webServer>
   <system.web>
     <authorization>
       <allow users="*" />
     </authorization>
   </system.web>
 </configuration>

-設定が完了したら【DocumentRoot?】/web.config のコメントアウトを解除する

***エラー対応 [#n3a9bd2c]
-[[Let’s Encrypt Timeoutエラー:https://tulist.club/technology/ssl/2017/10/09/95]]
-[[Acme server reported status 400 (on renewal)?:https://github.com/Lone-Coder/letsencrypt-win-simple/issues/560]]

*ACME [#yed86370]
-[[Automated Certificate Management Environment - Wikipedia:https://ja.wikipedia.org/wiki/Automated_Certificate_Management_Environment]]
-[[Let's Encrypt を支える ACME プロトコル:http://jxck.hatenablog.com/entry/letsencrypt-acme]]
-[[SSLサーバ証明書の自動更新を可能にするACMEプロトコルとは:https://college.globalsign.com/blog/acmeprotocol_211207/]]

*自己署名入り証明書 [#n662365a]
-[[IIS で SSL/TLS を 自己署名入り証明書 で 設定 する方法:https://garafu.blogspot.com/2014/03/iis-ssltls.html]]

*負荷 [#n554fca9]
-[[HTTPSのコスト:https://rms.ne.jp/Introduction_to_https/sni.html]]

*常時SSL化 [#hae012bb]
-[[必読!常時 SSL のススメ ~ 何故、常時 SSL 化をしなくてはならないのか?:https://www.cybertrust.co.jp/blog/ssl/knowledge/always-ssl.html?utm_source=owned&utm_medium=email&utm_campaign=pki-mag20210729]]


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS