Hi all,
I am trying to enable SSL with cerbot running the following command:
certbot --nginx
The server running on Ubuntu and the webserver is nginx, the nginx config is:
server {
listen 80;
listen [::]:80;
server_name test.mysite.io;
access_log /var/log/nginx/reverse-access.log;
error_log /var/log/nginx/reverse-error.log;
location ^~ /.well-known/acme-challenge/ {
root /var/www/html;
}
location / {
proxy_pass http://XXX.XXX.XXX.XXX:8080;
}
}
The output in `/var/log/letsencrypt/letsencrypt.log`:
2023-02-02 09:20:19,442:DEBUG:acme.client:JWS payload:
b''
2023-02-02 09:20:19,443:DEBUG:acme.client:Sending POST request to https://acme-v02.api.letsencrypt.org/acme/authz-v3/200202732737:
{
"protected": "eyJhbGciOiAiUlMyNTYiLCAia2lkIjogImh0dHBzOi8vYWNtZS12MDIuYXBpLmxldHNlbmNyeXB0Lm9yZy9hY21lL2FjY3QvODcxMzM5NjU3IiwgIm5vbmNlIjogIjVDQTJYRDJJaWU2QTJ1TTRfaUFFN19WdkFzR2FMY1d0aGZMeERpUm1kSEtwT1pzIiwgInVybCI6ICJodHRwczovL2FjbWUtdjAyLmFwaS5sZXRzZW5jcnlwdC5vcmcvYWNtZS9hdXRoei12My8yMDAyMDI3MzI3MzcifQ",
"signature": "T9Ptn86Bi6YDDzwdusyDtjFATQ_6QVWfIugBE2I9qRkFFZQKb9DfdI-qPJhRcve4JnMjmb6fn7sZBOjCN0ArPJ6tgtoJpS8DUuXvTtVQwe3GRZBsUVQUZ6wPJxT7LBSwCdt2TUiwtd8bJiUueDwtqBs7-_DVRFM7LTWxK5CxYfW-xe1wbeSI44Mqe5zQ4UhkONWsnrPROkectoz5k9JVUmJ20rtraLwCm5fOX49StbwwESvLaZJUeZSdvPut4Q_pjseTG3EdYiW_Kk2glIl-tYeRS_jH0oBUMsg0ws-lsA-Qk5edhezz67dWcocsS6a6oXyVBn6Rq_YQAR74I0yolw",
"payload": ""
}
2023-02-02 09:20:19,493:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "POST /acme/authz-v3/200202732737 HTTP/1.1" 200 801
2023-02-02 09:20:19,493:DEBUG:acme.client:Received response:
HTTP 200
Server: nginx
Date: Thu, 02 Feb 2023 09:20:19 GMT
Content-Type: application/json
Content-Length: 801
Connection: keep-alive
Boulder-Requester: 871339657
Cache-Control: public, max-age=0, no-cache
Link: <https://acme-v02.api.letsencrypt.org/directory>;rel="index"
Replay-Nonce: 5CA2A9bxz7IosCswn74YO1xc1r0aQu4D6gOCUsWw8Fr_GmU
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
{
"identifier": {
"type": "dns",
"value": "test.mysite.io"
},
"status": "pending",
"expires": "2023-02-09T09:20:11Z",
"challenges": [
{
"type": "http-01",
"status": "pending",
"url": "https://acme-v02.api.letsencrypt.org/acme/chall-v3/200202732737/p20HZw",
"token": "HATZ2wCZM-Jup0FTjBVjMCnFQePDf9hd0ZcvrNgOH2U"
},
{
"type": "dns-01",
"status": "pending",
"url": "https://acme-v02.api.letsencrypt.org/acme/chall-v3/200202732737/U5reAw",
"token": "HATZ2wCZM-Jup0FTjBVjMCnFQePDf9hd0ZcvrNgOH2U"
},
{
"type": "tls-alpn-01",
"status": "pending",
"url": "https://acme-v02.api.letsencrypt.org/acme/chall-v3/200202732737/mbeUCw",
"token": "HATZ2wCZM-Jup0FTjBVjMCnFQePDf9hd0ZcvrNgOH2U"
}
]
}
2023-02-02 09:20:19,493:DEBUG:acme.client:Storing nonce: 5CA2A9bxz7IosCswn74YO1xc1r0aQu4D6gOCUsWw8Fr_GmU
2023-02-02 09:20:22,497:DEBUG:acme.client:JWS payload:
b''
2023-02-02 09:20:22,499:DEBUG:acme.client:Sending POST request to https://acme-v02.api.letsencrypt.org/acme/authz-v3/200202732737:
{
"protected": "eyJhbGciOiAiUlMyNTYiLCAia2lkIjogImh0dHBzOi8vYWNtZS12MDIuYXBpLmxldHNlbmNyeXB0Lm9yZy9hY21lL2FjY3QvODcxMzM5NjU3IiwgIm5vbmNlIjogIjVDQTJBOWJ4ejdJb3NDc3duNzRZTzF4YzFyMGFRdTRENmdPQ1VzV3c4RnJfR21VIiwgInVybCI6ICJodHRwczovL2FjbWUtdjAyLmFwaS5sZXRzZW5jcnlwdC5vcmcvYWNtZS9hdXRoei12My8yMDAyMDI3MzI3MzcifQ",
"signature": "NCtGDO5fdsmFLXcSrCE1-dlgXUsTcFJy8EdIEI3A0tXNjYhrYYkozr_Y_MWe4Xl6zsK_Zn0mrv-4QHTHjKYkjdkikRwly6yl5EFNznbe_FgjULEs55t5P6B9tJqq0ikH9beMvEvXTDkmV5U6mMyWLX9rmRD0BOzfJSEJyUFSJU51D56O62b76lD7LtWajM9YjCoslTbsYgI2JPibKRkVk-FrJKq9ODASYacAGxhVB27FguhE33umu9yFLSL317W9uBAvSpwUPT1XUkNff5Bn3G4pfV2_-wILSfcgV7pN2iC_debnRTmv8uNh8khXqBZmFLaFrosq_ul4VyQxykDGMg",
"payload": ""
}
2023-02-02 09:20:22,546:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "POST /acme/authz-v3/200202732737 HTTP/1.1" 200 1060
2023-02-02 09:20:22,546:DEBUG:acme.client:Received response:
HTTP 200
Server: nginx
Date: Thu, 02 Feb 2023 09:20:22 GMT
Content-Type: application/json
Content-Length: 1060
Connection: keep-alive
Boulder-Requester: 871339657
Cache-Control: public, max-age=0, no-cache
Link: <https://acme-v02.api.letsencrypt.org/directory>;rel="index"
Replay-Nonce: 5CA2plz9u-6GaXETUgaBpihyEpX1Bqc1nypklTow2ot7-EU
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
{
"identifier": {
"type": "dns",
"value": "test.mysite.io"
},
"status": "invalid",
"expires": "2023-02-09T09:20:11Z",
"challenges": [
{
"type": "http-01",
"status": "invalid",
"error": {
"type": "urn:ietf:params:acme:error:connection",
"detail": "XXX.XXX.XXX.XXX: Fetching http://test.mysite.io/.well-known/acme-challenge/HATZ2wCZM-Jup0FTjBVjMCnFQePDf9hd0ZcvrNgOH2U: Timeout during connect (likely firewall problem)",
"status": 400
},
"url": "https://acme-v02.api.letsencrypt.org/acme/chall-v3/200202732737/p20HZw",
"token": "HATZ2wCZM-Jup0FTjBVjMCnFQePDf9hd0ZcvrNgOH2U",
"validationRecord": [
{
"url": "http://test.mysite.io/.well-known/acme-challenge/HATZ2wCZM-Jup0FTjBVjMCnFQePDf9hd0ZcvrNgOH2U",
"hostname": "test.mysite.io",
"port": "80",
"addressesResolved": [
"XXX.XXX.XXX.XXX"
],
"addressUsed": "XXX.XXX.XXX.XXX"
}
],
"validated": "2023-02-02T09:20:12Z"
}
]
}
2023-02-02 09:20:22,547:DEBUG:acme.client:Storing nonce: 5CA2plz9u-6GaXETUgaBpihyEpX1Bqc1nypklTow2ot7-EU
2023-02-02 09:20:22,547:INFO:certbot._internal.auth_handler:Challenge failed for domain test.mysite.io
2023-02-02 09:20:22,547:INFO:certbot._internal.auth_handler:http-01 challenge for test.mysite.io
2023-02-02 09:20:22,547:DEBUG:certbot._internal.display.obj:Notifying user:
Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Domain: test.mysite.io
Type: connection
Detail: XXX.XXX.XXX.XXX: Fetching http://test.mysite.io/.well-known/acme-challenge/HATZ2wCZM-Jup0FTjBVjMCnFQePDf9hd0ZcvrNgOH2U: Timeout during connect (likely firewall problem)
Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet.
2023-02-02 09:20:22,547:DEBUG:certbot._internal.error_handler:Encountered exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/certbot/_internal/auth_handler.py", line 90, in handle_authorizations
self._poll_authorizations(authzrs, max_retries, best_effort)
File "/usr/lib/python3/dist-packages/certbot/_internal/auth_handler.py", line 178, in _poll_authorizations
raise errors.AuthorizationError('Some challenges have failed.')
certbot.errors.AuthorizationError: Some challenges have failed.
2023-02-02 09:20:22,548:DEBUG:certbot._internal.error_handler:Calling registered functions
2023-02-02 09:20:22,548:INFO:certbot._internal.auth_handler:Cleaning up challenges
2023-02-02 09:20:23,624:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File "/usr/bin/certbot", line 33, in <module>
sys.exit(load_entry_point('certbot==1.21.0', 'console_scripts', 'certbot')())
File "/usr/lib/python3/dist-packages/certbot/main.py", line 15, in main
return internal_main.main(cli_args)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 1574, in main
return config.func(config, plugins)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 1287, in run
new_lineage = _get_and_save_cert(le_client, config, domains,
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 133, in _get_and_save_cert
lineage = le_client.obtain_and_enroll_certificate(domains, certname)
File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", line 459, in obtain_and_enroll_certificate
cert, chain, key, _ = self.obtain_certificate(domains)
File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", line 389, in obtain_certificate
orderr = self._get_order_and_authorizations(csr.data, self.config.allow_subset_of_names)
File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", line 439, in _get_order_and_authorizations
authzr = self.auth_handler.handle_authorizations(orderr, self.config, best_effort)
File "/usr/lib/python3/dist-packages/certbot/_internal/auth_handler.py", line 90, in handle_authorizations
self._poll_authorizations(authzrs, max_retries, best_effort)
File "/usr/lib/python3/dist-packages/certbot/_internal/auth_handler.py", line 178, in _poll_authorizations
raise errors.AuthorizationError('Some challenges have failed.')
certbot.errors.AuthorizationError: Some challenges have failed.
2023-02-02 09:20:23,625:ERROR:certbot._internal.log:Some challenges have failed.
Would you advise if I missed something here?
I have masked the domain for privacy.