Help with setting up letsencrypt

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g., so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command: sudo certbot --apache

It produced this output:

sudo certbot --apache

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):

Obtaining a new certificate

Performing the following challenges:

http-01 challenge for

Enabled Apache rewrite module

Waiting for verification…

Cleaning up challenges

Failed authorization procedure. (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from 400


  • The following errors were reported by the server:


Type: unauthorized

Detail: Invalid response from

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.

My web server is (include version): Apache

The operating system my web server runs on is (include version): Ubuntu 18.04

My hosting provider, if applicable, is: freenom

I can login to a root shell on my machine (yes or no, or I don’t know): Yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): no

What am i doing wrong?

Hi @andersovreseth

your server sends a http status 400 - Bad request ( ):

Domainname Http-Status redirect Sec. G 400 0.087 M 400 0.086 M 200 5.953 N
Certificate error: RemoteCertificateNameMismatch, RemoteCertificateChainErrors 200 5.980 N
Certificate error: RemoteCertificateNameMismatch, RemoteCertificateChainErrors 400 0.087 M 400 0.086 M

The result:

Bad Request
This combination of host and port requires TLS.

works, so you send https over port 80.

So check / share your port 80 - configuration. There is no ssl allowed.

hmm, yes, probably. How can I change this? Is it an apache setting?

On port 80, there’s a UniFi login screen. Did you perhaps map port 80 to some Ubiquiti device in your router?

External port 80 as wel as port 443 should obviously connect to your Apache server.

Agreed, it seems both 80 and 443 are going to some UniFi SDN device:
forwards to:

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