Error while installing SSL certificate

OS = Ubuntu 16.04
Web server = nignx

I will install ssl certificate on the following domain (

sudo certbot --nginx -d
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Starting new HTTPS connection (1):
Obtaining a new certificate
An unexpected error occurred:
The request message was malformed :: Error creating new authz :: Invalid character in DNS name

I installed letsencrypt certificate on the same server, but to ( and it works fine.

You can’t add a port number, that’s not part of a hostname.

this server has 2 projects, the first one on the 443 port, the second one on 4000 port.
the first one works correctly, but the second is not, what should I do?

Two projects, both with the same domain name? The port number is not a part of the hostname as previously mentioned and therefore is not relevant to the certificate creation.

Or, are there two different domains involved? If so, you will need either two different certificates or a certificate with a SAN depending upon how you wish to configure the webserver.

If they’re on the same domain name, the certificate you already got for port 443 should be equally valid for any other port. You don’t need to get a second certificate, you just need to configure the server on the other port to use the same certificate.

1 Like

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