Certbot-auto unable to complete TLS-SNI-01 challenge on Ubuntu 14.04

Ok, I figured out what my problem was.

I discovered the issue after I tried the webroot method, which worked because it uses http. However when I configured apache to use the new certificate, it continued to serve http. Setting the virtualhost to _default_ made https work, but I knew that setting wasn’t necessary on the working server. I looked into reverse dns lookups for my host and noticed that some dns servers didn’t know the reverse ip.

That wasn’t the issue but it gave me the idea of looking in the /etc/hosts file. The entry for my.domain was incorrect. It turns out that when creating the virtual machine I had used the wrong ip address. I later went in and changed it manually in /etc/network/interfaces and /etc/xen/my.domain.cfg, but I forgot to change /etc/hosts.

Once I corrected /etc/hosts, the normal TLS-SNI-01 method worked. :slight_smile:

That’s a really interesting issue. Would you be willing to post an issue at https://github.com/certbot/certbot/issues/new with instructions to reproduce? It would be great if we could detect this issue and fix it. It’s also a little surprising to me that the /etc/hosts issue should result in serving HTTP on port 443, so there might be some deeper issue we need to detect and fix.

In light of @sudoman’s update I just wanted to pass along that I don’t have any /etc/hosts mismatch like that. Though if it matters for some reason, I don’t have the domain name I was requesting the cert for in /etc/hosts at all (I only have localhost and the server’s primary name in /etc/hosts). Also, the name I am requesting the cert for does not reverse resolve to itself (though it does reverse resolve).

I’ve created a ticket for the issue I was having: https://github.com/certbot/certbot/issues/3871

@QuantumMechanic fwiw, you may have to resolve the domain from an name to an ip address before reverse resolving it with your dns server of choice.

@sudoman Not sure what you’re trying to get at. This is a machine with a single IP address hosting multiple domains. It is therefore literally impossible for every domain to resolve-reverse-resolve to itself. One of the domains resolve-reverse-resolves to itself and all the others resolve-reverse-resolve to that one. (Anyhow, that’s getting off the topic of the overall discussion.)

@cpu @jsha @pfg

I fixed it! (Courtesy of an answer to a similar question on StackOverflow).
My virtual host declarations were like this:

<VirtualHost *>

When I changed them to

<VirtualHost *:80>

then certbot started working fine.

Is certbot supposed to require that or is that a bug?

2 Likes

@bmw @erica, could one of you look into whether certbot does the right thing here?

Thanks,
Jacob

I was able to reproduce the problem. I created https://github.com/certbot/certbot/issues/3981 to track the issue.

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