Errors while trying to set up a SSL certificate

Hey there,
im trying to set up a SSL-Certificate on Nginx with letsencrypt-auto for the domain “myiria.de

The command i run is:
./letsencrypt-auto certonly --standalone -d myiria.de

What i get is:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for myiria.de
Waiting for verification...
Challenge failed for domain myiria.de
http-01 challenge for myiria.de
Cleaning up challenges
Some challenges have failed.

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: myiria.de
   Type:   unauthorized
   Detail: Invalid response from
   http://myiria.de/.well-known/acme-challenge/KTc06qQ5ZEBCg-MAF9V5MJjDzwAxYld5LWa5yt8kFiY
   [92.42.47.182]: "<html>\n<head><meta http-equiv=\"refresh\"
   content=\"1\" /><meta http-equiv=\"cache-control\"
   content=\"max-age=0\" /><meta http-equiv=\"c"

   To 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.

The error says unauthorized but you can access a file called test.txt which is placed into /.well-known/acme-challenge/ (http://myiria.de/.well-known/acme-challenge/test.txt)

Letsencrypt log:
/var/log/letsencrypt/letsencrypt.log -> https://pastebin.com/X0k4eYir

Some commands:

./letsencrypt-auto --version ->
certbot 0.34.2

./letsencrypt-auto certificates ->
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
No certs found.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

If you need any additional information just ask

Thanks in advance for helping

  • David :slightly_smiling_face:

--standalone doesn’t make sense if you are running nginx.

Try -a nginx instead.

Remove --standalone and adding -a nginx to the command does not fix the problem and the output is still the same

if the nginx mode doesn’t work for whatever reason, you can also try webroot (in line with your test.txt example).

letsencrypt-auto certonly --webroot -w /var/www/html -d myiria.de

Substitute /var/www/html for the document root of your domain (not including the .well-known/acme-challenge bit).

Im still getting the same error and i tried a lot of things before writing this post

Hi @david_wagn

your setup may not work ( https://check-your-website.server-daten.de/?q=myiria.de ):

Domainname Http-Status redirect Sec. G
http://myiria.de/
92.42.47.182 200 0.036 H
http://www.myiria.de/
92.42.47.182 200 0.033 H
https://myiria.de/
92.42.47.182 200 1.646 N
Certificate error: RemoteCertificateNameMismatch, RemoteCertificateChainErrors
https://www.myiria.de/
92.42.47.182 200 1.323 N
Certificate error: RemoteCertificateNameMismatch, RemoteCertificateChainErrors
http://myiria.de/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de
92.42.47.182 200 0.037
Visible Content:
http://www.myiria.de/.well-known/acme-challenge/check-your-website-dot-server-daten-dot-de
92.42.47.182 404 0.036 A
Not Found
Visible Content: 404 Not Found nginx/1.10.3

http + www sends the expected http status 404 - Not Found.

But http + non-www has a http status 200. Checking that manual there is a JavaScript:

<html>
<head><meta http-equiv="refresh" content="1" /><meta http-equiv="cache-control" content="max-age=0" /><meta http-equiv="cache-control" content="no-cache" /><meta http-equiv="expires" content="-1" /><meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" /><meta http-equiv="pragma" content="no-cache" /></head>
<script type="text/javascript">
function getCookie(w){
	cName = "";
	pCOOKIES = new Array();
	pCOOKIES = document.cookie.split('; ');
	for(bb = 0; bb < pCOOKIES.length; bb++){
		NmeVal  = new Array();
		NmeVal  = pCOOKIES[bb].split('=');
		if(NmeVal[0] == w){
			cName = unescape(NmeVal[1]);
		}
	}
	return cName;
}
function printCookies(w){
	cStr = "";
	pCOOKIES = new Array();
	pCOOKIES = document.cookie.split('; ');
	for(bb = 0; bb < pCOOKIES.length; bb++){
		NmeVal  = new Array();
		NmeVal  = pCOOKIES[bb].split('=');
		if(NmeVal[0]){
			cStr += NmeVal[0] + '=' + unescape(NmeVal[1]) + '; ';
		}
	}
	return cStr;
}
function setCookie(name, value, expires, path, domain, secure){
	var vlad = name + "=" + escape(value);
	if(expires){
		expires = setExpiration(expires);
		vlad += ";expires=" + expires;
	}
	if(path){
		vlad += ";path=" + path;
	}
	if(domain){
		vlad += ";domain=" + domain;
	}
	if(secure){
		vlad += ';secure';
	}
document.cookie = vlad;
}
function setExpiration(cookieLife){
    var today = new Date();
    var expr = new Date(today.getTime() + cookieLife * 24 * 60 * 60 * 1000);
    return  expr.toGMTString();
}
function delete_cookie(name){
  document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}
</script>
<script type="text/javascript">
delete_cookie('fb620561f4f8b25819e9b3c4fad75f85');
setCookie('fb620561f4f8b25819e9b3c4fad75f85', 'Yes', '3', '/', '300', '');
</script>
<body>
</body>
</html>

Looks like a bot detection to check the cookie.

A browser is redirected to the correct result http status 404. Letsencrypt sees the wrong content.

Did you install that script? Or is it something from your hoster?

You should remove that.

Oh i see. No i didnt install a script like that im pretty sure its something from the hoster

I have one other server (173.212.233.88) that is also running nginx and i had no problem with letsencrypt there

Where could that script be? Because i dont think its on the server the website is on

I don't know.

Info: Different Server-Headers found

Your normal header:

Server: nginx/1.10.3

The header of this answer:

Server: nginx

Maybe your own server, maybe your hoster.

Check your other server (ip or domain name) with the online tool to see the answer.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.