Attempting to renew cert (jenny.besch.ws) from /etc/letsencrypt/renewal/jenny.besch.ws.conf produced an unexpected error: Failed authorization procedure. jenny.besch.ws (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://www.besch.ws/Jenny:Besch.well-known/acme-challenge/QJ6OweP1O9xhFGn2tUHl8RNRGnWVNjfNfy77QWE-8xs [2001:67c:1400:2180::1]: "<!DOCTYPE html>\n<html class=\"client-nojs\" lang=\"de\" dir=\"ltr\" version=\"HTML+RDFa 1.0\">\n<head>\n<meta charset=\"UTF-8\"/>\n<title>Anm". Skipping.
In the end not really a surprise. But how to renew?
I tried a couple of rewrite rules which should fire up correctly just for the challenge and use https://www.besch.ws/.well-known/acme-challenge/.... , but in the end I always get errors. Moreover the subdomain redirection fires up incorrectly for non challenge requests too.
Example:
RewriteEngine on
RewriteRule ^.well-known/acme-challenge/ - [L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
which I found here in some thread but this ends in disaster, too.
In the end I need a rewrite rule that takes the challenge for jenny.besch.ws and takes it to www.besch.ws and all es good.
It will be nice to be able to certify a redirecting subdomain. I understand that it is not possible to redirect a https site without a cert even if it is just a simple redirect. Any help appreciated.
So, I don't really understand the need to redirect the challenge requests (to the same site - wasted step).
And also must point out the obvious:
LE prefers IPv6 over IPv4 when present (as is the case here).
But the IPv6 address doesn't return the expected (similar to IPv4); as shown here:
[abbreviated outputs for immediate clarity]
So, it seems that ALL IPv6 connections are presently failing with "403 Forbidden".
You can remove the IPv6 ("AAAA") record from your DNS zone.
Or, if possible, fix the system so that it can serve the same content via both IPv6 and IPv4.
I believed that it may perhaps help. Something like this was suggested in other posts. I do not insist. Anyhow without it it does not work and this is what brought me here.
Good to know. I was not aware. However this is not the issue here. I have a couple of websites on the same server with the very same AAAA records for them and the challenges work perfect. Moreover ...
Well, I cannot explain. Once I let jenny.besch.ws use the webroot with some html doc the verification works, even without a presumably borked IPv6 setup. Also it does not appear to be totally borked since the response from IPv6 goes to correct spot for login to the website: The client lacks sufficient authorization :: Invalid response from Anmeldung erforderlich – Besch [2001:67c:1400:2180::1]:
When certbot tries to perform the challenge it derails with:
Attempting to renew cert (jenny.besch.ws) from /etc/letsencrypt/renewal/jenny.besch.ws.conf produced an unexpected error: Failed authorization procedure. jenny.besch.ws (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from Anmeldung erforderlich – Besch [2001:67c:1400:2180::1]: "\n<html class="client-nojs" lang="de" dir="ltr" version="HTML+RDFa 1.0">\n\n<meta charset="UTF-8"/>\nAnm". Skipping.
Probably because <www.besch.ws> is handled by some rewrite rules which should not be applied when certbot challenges. These are to be ignored by cerbot:
To cut it short. How to I get certbot to ignore the rewrite rules for <www.besch.ws>? I figured that putting some rewrite rules to <jenny.besch.ws> just for certbot could do the trick but I am not sure. Perhaps some rewrite rule just for certbot needs to be added to <www.besch.ws> instead of fiddling with <jenny.besch.ws>.
Instead of calling https://www.besch.ws/Jenny:Besch.well-known/acme-challenge/... only https://www.besch.ws/.well-known/acme-challenge/... should be called.
I still suspect that we need to add some redirection to <www.besch.ws> which is just firing up for certbot. Unfortunately I am not the Apache redirect creation guy, I'm afraid.
You have to include a Rewrite Condition that handles the challenge requests from LE (per request from certbot).
Adding in something like this might work:
However now when I access https://jenny.besch.ws I get redirected to https://www.besch.ws/.well-known/ instead of https://www.besch.ws/Jenny:Besch. Thus I still have an issue. The redirect is not unnecessary since this is exactly what the subdomain should do, point whatever calls it to https://www.besch.ws/Jenny:Besch.
This is basically the reason why I am here. Point certbot to the correct challenge location and all the rest to the redirection location. This is exactly my dilemma.
Hmm, hold on. Perhaps this was a browser cache issue. Now <jenny.besch.ws> actually also does redirect to https://www.besch.ws/Jenny:Besch - which is good. If this is true this will have resolved my issue.