表題の通りSSLを導入したいのですがうまくいきません。
Raspbianのバージョン
$ sudo cat /etc/debian_version
9.3
$
ドメイン取得済(以下**{mydomain}**)
DDNS(mydns.jp)を利用しWANのグローバルIPに紐付け
NTT西日本のHGW(PR-400KI)の静的NAT設定にてポートは解放済み
iptabelesの設定
target / port / source / destnation
ACCEPT / tcp / anywhere / anywhere state RELATED,ESTABLISHED
ACCEPT / udp / anywhere / anywhere udp spt:domain
ACCEPT / tcp / anywhere / anywhere tcp dpt:ssh
ACCEPT / tcp / anywhere / anywhere tcp dpt:https
ACCEPT / tcp / anywhere / anywhere tcp dpt:http
外部ネットワークのブラウザから"http://{mydomain}/"で表示されることを確認
ラズベリーパイでの作業
certbotの導入
https://certbot.eff.org/ から apache/Debian(other)用のcertbot-autoをダウンロード
$ sudo systemctl stop apache2
apache2の停止を確認し
$ sudo ./certbot-auto --apache
WARNING: unable to check for updates.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated) (Enter 'c' to cancel): {mydomain} #ドメインを入力
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for {mydomain}
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. {mydomain} (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://{mydomain}/.well-known/acme-challenge/xxxxxxxxxx-xxxxxxxx:
Timeout
IMPORTANT NOTES:
-
The following errors were reported by the server:
Domain: {mydomain}
Type: connection
Detail: Fetching
http://{mydomain}/.well-known/acme-challenge/xxxxxxxxxx-xxxxxxxx:
TimeoutTo fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you're using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.
何度やっても上記の通りTimeoutで成功しません。
Aレコードはmydns.jpにて設定してあり、何故このようなエラーになるのかがわかりません。
この後、同じネットワークからも外部からもアクセスできなくなりました。
/var/log/letsencrypt/letsencrypt.log
エラーログは長すぎて素人には意味不明
※ログの気になる部分
"validationRecord": [
{
"url": "http://{mydomain}/.well-known/acme-challenge/xxxxxxxxxx-xxxxxxxx",
"hostname": "{mydomain}",
"port": "80",
"addressesResolved": [
"xxx.xxx.xxx.xxx", #ipv4のグローバルIP
"XXXX:XXXX:XXXX:xxx::xxx" #ipv6のグローバルIP
],
"addressUsed": "XXXX:XXXX:XXXX:xxx::xxx" #なぜかipv6しか表示されていない??
}
]
一連の作業で下記のファイルが作成されていることを確認
/etc/ssl/certs/ssl-cert-snakeoil.pem
/etc/ssl/private/ssl-cert-snakeoil.key
また下記のconfファイルに上記2つの記述があることを確認
/etc/apache2/sites-available/default-ssl.conf
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
/etc/apache2/ports.conf の内容
Listen 80
<IfModule ssl_module> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule>しかし、443ポートはListenされておりません。
長々と、醜い書き方で大変申し訳ないですが、何卒ご教示お願い申し上げます。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/02/15 00:41
2018/02/15 00:54
2018/02/15 01:00 編集
2018/02/15 07:26
2018/02/15 07:51
2018/02/15 08:57
2018/02/16 02:30