let's encryptにしてみた 2
2017.05.03
前回の操作で無事(?)証明書をgetしました
C:\[ユーザーディレクトリ]\AppData\Roaming\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org
にいろいろファイルが出来上がってるのでチェックしてみます
ca-0A0141420000015385736A0B85ECA708-crt.der <=Let's Encryptの中間証明書(バイナリ)
ca-0A0141420000015385736A0B85ECA708-crt.pem 
<=Let's Encryptの中間証明書(BASE64)
expouch.net-all.pfx 
<=pkcs12公開キーと秘密キーがいっしょになってるやつ、パスは設定されてない
expouch.net-chain.pem 
<=取得した証明書+中間証明のチェーン(BASE64)
expouch.net-crt.der
 <=取得した証明書(バイナリ)
expouch.net-crt.pem 
<=取得した証明書(BASE64)
expouch.net-csr.pem 
<=証明取得要求ファイル
expouch.net-key.pem <=秘密キー


expouch.net-crt.pem と expouch.net-key.pem をサーバーに設定して終了です。
expouch.net-chain.pem と expouch.net-key.pem をサーバーに設定して終了です。(5/10)


更新処理については後日!
2017.05.03 17:06 | 固定リンク | アップローダー
let's encryptにしてみた 1
2017.05.03
今まで使っていたStartComさんが
いろいろやらかしているので、ルート証明がころころ変わって面倒なので、
この度、let's encryptデビューしました!
うちのサーバー環境がwindowsなので↓を参考に

IISでLet's Encrypt を利用してSSLサイトを構築する (letsencrypt-win-simple クライアントを利用)

SubjectAltName(SAN)も使っていいるので

おきつねさまのひまこみゅ: Let's Encrypt を・・・

見ればすぐわかるけど、上記2つともIISのお話ですが、
うちで使っているのは04webserver!!
もちろん letsencrypt-win-simple が、自動で設定を読み込んでくれるわけもなく
仕方がないので手動で行いました。

以下コマンド

c:\[letsencrypt作業ディレクトリ]>letsencrypt --san <=SAN使うので[--san]追加
The global logger has been configured
Let's Encrypt (Simple Windows ACME Client)
Renewal Period: 60
Certificate Store: WebHosting
ACME Server: https://acme-v01.api.letsencrypt.org/
Config Folder: C:\[ユーザーディレクトリ]\AppData\Roaming\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org
Certificate Folder: C:\
[ユーザーディレクトリ]\AppData\Roaming\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org
Loading Signer from C:\
[ユーザーディレクトリ]\AppData\Roaming\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org\Signer
Getting AcmeServerDirectory
Loading Registration from C:\
[ユーザーディレクトリ]\AppData\Roaming\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org\Reg
istration
Scanning IIS Sites
IIS Version not found in windows registry. Skipping scan.
No targets found.


 W: Generate a certificate via WebDav and install it manually.
 S: Generate a single San certificate for multiple sites.
 <=[--san]使うと現れる
 
F: Generate a certificate via FTP/ FTPS and install it manually.
 M: Generate a certificate manually.
 A: Get certificates for all hosts
 Q: Quit
Choose from one of the menu options above:
M <=マニュアルで
Enter a host name: expouch.net <=コモンネームになる
Enter all Alternative Names seperated by a comma expouch.net,www.expouch.net,koge.me,5oo.jp<=コンマで区切る
Enter a site path (the web root of the host for http authentication): C:/[公開webルートディレクトリ]
Authorizing Identifier expouch.net Using Challenge Type http-01
Writing challenge answer to
C:/[公開webルートディレクトリ]\.well-known/acme-challenge/XEq...[略]
Answer should now be browsable at http://expouch.net/.well-known/acme-challenge/XEq
...[略]
Submitting answer
Refreshing authorization
Authorization Result: valid

...[略]
Authorizing Identifier koge.me Using Challenge Type http-01
Writing challenge answer to
C:/[公開webルートディレクトリ]\.well-known/acme-challenge/xa0...[略]
Answer should now be browsable at http://koge.me/.well-known/acme-challenge/xa0
...[略]
Submitting answer
Refreshing authorization
Authorization Result: invalid
Authorization Failed invalid

******************************************************************************
The ACME server was probably unable to reach http://koge.me/.well-known/acme-challenge/xa0
...[略]
Check in a browser to see if the answer file is being served correctly.

******************************************************************************
...[略]

なんかエラー出た!!
http://koge.me/.well-known/acme-challenge/xa0...[略] にアクセスできんよって...
ディレクトリ指定してないしな!
仕方がないので、エイリアスに
/.well-known/を追加して、
リンク先に
C:/[公開webルートディレクトリ]\.well-knownを設定
とりあえずこれでやり直すと


Authorization Result: valid
Requesting Certificate
Request Status: Created
Saving Certificate to C:\
[ユーザーディレクトリ]\AppData\Roaming\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org\expouch.net-crt.der
Saving Issuer Certificate to C:\
[ユーザーディレクトリ]\AppData\Roaming\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org\ca-0A0141420000015385736A0B85ECA708-crt.pem
Saving Certificate to C:\
[ユーザーディレクトリ]\AppData\Roaming\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org\expouch.net-all.pfx
Installing Non-Central SSL Certificate in the certificate store
Opened Certificate Store My
 Set private key exportable
Set private key exportable
Adding Certificate to Store
Closing Certificate Store
Installing Non-Central SSL Certificate in server software
 WARNING: Unable to configure server software.
Opened Certificate Store My
Closing Certificate Store
Adding renewal for Manual expouch.net (
C:/[公開webルートディレクトリ])
Creating Task letsencrypt-win-simple httpsacme-v01.api.letsencrypt.org with Windows Task scheduler at 9am every day.

Do you want to specify the user the task will run as? (y/n) y
Enter the username (Domain\username): ユーザー
Enter the user's password: ****************************
Renewal Scheduled Manual expouch.net (
C:/[公開webルートディレクトリ]) Renew After 2017/07/02
Press enter to continue.


長くなったので分けます。
2017.05.03 15:51 | 固定リンク | アップローダー

- CafeNote -