#Let's encryptで特定のディレクトリ?サブドメイン?が認証できない
特定のある一つのディレクトリ?サブドメインのみ、Let's Encrypt でSSL証明書を取得しようとすると、Not found になってしまいます。
該当するWeb は http://err.hogehoge.com/ 等として、きちんと見ることができます。
該当ディレクトリ及び該当サブドメインは、エラードキュメントに関してのみ記述されています。
他のディレクトリ、他のドメイン&サブドメインでは、きちんと認証されます。
##環境
対象ドメイン:err.hogehoge.com
対象ディレクトリ:/home/errdoc/htdocs
OS:FreeBSD 11.1
HTTPD:nginx 1.12.2 cached Apache 2.4.33
certbot 0.23.0
##やってみたことその1
apache
1# ↓要するにエラードキュメントの全コメント化 2#ErrorDocument 500 http://err.hogehoge.com/err500.html 3#ErrorDocument 501 http://err.hogehoge.com/err501.html 4#ErrorDocument 502 http://err.hogehoge.com/err502.html 5#ErrorDocument 503 http://err.hogehoge.com/err503.html 6#ErrorDocument 504 http://err.hogehoge.com/err504.html 7#ErrorDocument 402 http://err.hogehoge.com/err402.html 8#ErrorDocument 403 http://err.hogehoge.com/err403.html 9#ErrorDocument 404 http://err.hogehoge.com/err404.html 10#ErrorDocument 405 http://err.hogehoge.com/err405.html
##やってみたことその2
b
1rm /home/errdoc/htdocs/.htaccess
##やってみたことその3
b
1# certbot certonly --webroot -w /home/errdoc/htdocs -d err.hogehoge.com 2 3Saving debug log to /var/log/letsencrypt/letsencrypt.log 4Plugins selected: Authenticator webroot, Installer None 5Obtaining a new certificate 6Performing the following challenges: 7http-01 challenge for err.hogehoge.com 8Using the webroot path /home/errordoc/htdocs for all unmatched domains. 9Waiting for verification... 10Cleaning up challenges 11Failed authorization procedure. err.hogehoge.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://err.hogehoge.com/.well-known/acme-challenge/NBuJUISVZJu8_UJf2Cc0erQQUfyrgFnngUYp4df4GNg: "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 12<html><head> 13<title>404 Not Found</title> 14</head><body> 15<h1>Not Found</h1> 16<p" 17 18IMPORTANT NOTES: 19 - The following errors were reported by the server: 20 21 Domain: err.hogehoge.com 22 Type: unauthorized 23 Detail: Invalid response from 24 http://err.hogehoge.com/.well-known/acme-challenge/NBuJUISVZJu8_UJf2Cc0erQQUfyrgFnngUYp4df4GNg: 25 "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 26 <html><head> 27 <title>404 Not Found</title> 28 </head><body> 29 <h1>Not Found</h1> 30 <p" 31 32 To fix these errors, please make sure that your domain name was 33 entered correctly and the DNS A/AAAA record(s) for that domain 34 contain(s) the right IP address. 35
##↑のアクセスログ
text
1#どこにも存在しない
##生成されたディレクトリだけアクセスしてみる
http://err.hogehoge.com/.well-known/acme-challenge/ にアクセスすることは成功しました。
##/var/log/letsencrypt/letsencrypt.log の抜粋
全部乗せると文字数オーバーエラーになるので、抜粋しました。
text
12018-04-25 16:04:09,690:DEBUG:acme.client:Received response: 2HTTP 200 3Server: nginx 4Content-Type: application/json 5Link: <https://acme-v01.api.letsencrypt.org/acme/new-cert>;rel="next" 6Replay-Nonce: -ss7fw6vZOpTd0EZ--6EZOl5tz2GdX2LNuxWFI03eak 7X-Frame-Options: DENY 8Strict-Transport-Security: max-age=604800 9Content-Length: 2082 10Expires: Wed, 25 Apr 2018 07:04:09 GMT 11Cache-Control: max-age=0, no-cache, no-store 12Pragma: no-cache 13Date: Wed, 25 Apr 2018 07:04:09 GMT 14Connection: keep-alive 15 16{ 17 "identifier": { 18 "type": "dns", 19 "value": "err.hogehoge.com" 20 }, 21 "status": "invalid", 22 "expires": "2018-05-02T07:04:06Z", 23 "challenges": [ 24 { 25 "type": "http-01", 26 "status": "invalid", 27 "error": { 28 "type": "urn:acme:error:unauthorized", 29 "detail": "Invalid response from http://err.hogehoge.com/.well-known/acme-challenge/nJ8tiYbhAmOq_Xii4ovN1hdrnlezk0B17dwPF5YYkv8: \"\u003c!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"\u003e\n\u003chtml\u003e\u003chead\u003e\n\u003ctitle\u003e404 Not Found\u003c/title\u003e\n\u003c/head\u003e\u003cbody\u003e\n\u003ch1\u003eNot Found\u003c/h1\u003e\n\u003cp\"", 30 "status": 403 31 }, 32 "uri": "https://acme-v01.api.letsencrypt.org/acme/challenge/rpTlgSbCU75epUliP0ZjsA3ftpNTWNziBDKqALuP5c4/4366698398", 33 "token": "nJ8tiYbhAmOq_Xii4ovN1hdrnlezk0B17dwPF5YYkv8", 34 "keyAuthorization": "nJ8tiYbhAmOq_Xii4ovN1hdrnlezk0B17dwPF5YYkv8.JtQ0Im9wZo65Y-EDk0acMKYkmggnK56xrtO6zfGpz2Y", 35 "validationRecord": [ 36 { 37 "url": "https://err.hogehoge.com/.well-known/acme-challenge/nJ8tiYbhAmOq_Xii4ovN1hdrnlezk0B17dwPF5YYkv8", 38 "hostname": "err.hogehoge.com", 39 "port": "443", 40 "addressesResolved": [ 41 "(正しいIPV4アドレス)", 42 "(正しいIPV6アドレス)" 43 ], 44 "addressUsed": "(正しいIPV4アドレス)" 45 }, 46 { 47 "url": "http://err.hogehoge.com/.well-known/acme-challenge/nJ8tiYbhAmOq_Xii4ovN1hdrnlezk0B17dwPF5YYkv8", 48 "hostname": "err.hogehoge.com", 49 "port": "80", 50 "addressesResolved": [ 51 "(正しいIPV4アドレス)", 52 "(正しいIPV6アドレス)" 53 ], 54 "addressUsed": "(正しいIPV6アドレス)" 55 } 56 ] 57 }, 58 { 59 "type": "dns-01", 60 "status": "invalid", 61 "uri": "https://acme-v01.api.letsencrypt.org/acme/challenge/rpTlgSbCU75epUliP0ZjsA3ftpNTWNziBDKqALuP5c4/4366698399", 62 "token": "ufdMs6k6P0-BwLukNR90RjGI-dVUIH7b6AGyMxc592w" 63 } 64 ], 65 "combinations": [ 66 [ 67 1 68 ], 69 [ 70 0 71 ] 72 ] 73}




回答1件
あなたの回答
tips
プレビュー