Koozali.org: home of the SME Server

Obsolete Releases => SME 9.x Contribs => Topic started by: john56 on November 17, 2016, 06:07:57 PM

Title: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: john56 on November 17, 2016, 06:07:57 PM
Hi, I am stuck at this step:

Quote
db hosts setprop www.mydomain.com letsencryptSSLcert enabled
db domains setprop mydomain.com  letsencryptSSLcert enabled

My subdomain is buzz.kerplouz.com (for https://buzz.kerplouz.com/roundcube/ and others)

What do I write?

Thanks
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: janet on November 19, 2016, 01:26:03 PM
john56

I think you would write:

db hosts setprop buzz.kerplouz.com letsencryptSSLcert enabled
db domains setprop buzz.kerplouz.com letsencryptSSLcert enabled
(Each of the two commands above are on one line each)

To be sure they are activated also do
signal-event post-upgrade
signal-event reboot


Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: DanB35 on November 19, 2016, 01:32:25 PM
@john56, your post has a title and contents that don't match--are you getting the subject error at some point?  If so, when?

To the text of your post, it's really going to depend on whether (1) buzz.kerplouz.com is the only hostname you want the certificate to cover (because TLS certificates from Let's Encrypt can include up to 100 hostnames), and (2) whether your SME server considers buzz.kerplouz.com to be a hostname or a domain name.  To determine the latter, run 'db hosts show' and 'db domains show', and see which of those commands lists "buzz.kerplouz.com".
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: john56 on November 19, 2016, 01:35:55 PM
buzz.kerplouz.com=domain
But www.kerplouz.com exists in another registar (in their panel, i've created buzz.kerplouz.com going to my public ip adress)
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: DanB35 on November 19, 2016, 01:38:56 PM
If that's a domain, then you'd run 'db domains setprop buzz.kerplouz.com letsencryptSSLcert enabled'.  If there aren't any other hostnames you want included in the cert, you wouldn't need to set that for any hosts.
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: john56 on November 19, 2016, 01:46:47 PM

ERROR: Challenge is invalid! (returned: invalid) (result: {
  "type": "http-01",
  "status": "invalid",
  "error": {
    "type": "urn:acme:error:connection",
    "detail": "DNS problem: NXDOMAIN looking up A for www.buzz.kerplouz.com",
    "status": 400
  },
  "uri": "https://acme-staging.api.letsencrypt.org/acme/challenge/Xb3Ptx_yFSCwa1FxK4JDUQ48mYk3p9KkhL8YtkJD3II/17009668",
  "token": "r2_RGG8-HhXcA2vXQwbrYWNDXYeEL3uSN8J2qIfr8zc",
  "keyAuthorization": "r2_RGG8-HhXcA2vXQwbrYWNDXYeEL3uSN8J2qIfr8zc.QRGFiL6dAIfkkfegatIKqhQ4uBivliQKBBJwX2YdbEA",
  "validationRecord": [
    {
      "url": "http://www.buzz.kerplouz.com/.well-known/acme-challenge/r2_RGG8-HhXcA2vXQwbrYWNDXYeEL3uSN8J2qIfr8zc",
      "hostname": "www.buzz.kerplouz.com",
      "port": "80",
      "addressesResolved": null,
      "addressUsed": ""
    }
  ]
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: DanB35 on November 19, 2016, 01:50:15 PM
Well, that's not the same FQDN.  buzz.kerplouz.com is not the same as www.buzz.kerplouz.com, and though there's an A record for buzz.kerplouz.com, there's no such record for www.buzz.kerplouz.com.  Have you enabled Let's Encrypt for any other hostnames?

Edit:  What's the output of 'db hosts show www.buzz.kerplouz.com'?
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: john56 on November 19, 2016, 01:55:49 PM
http://www.buzz.kerplouz.com/ does'nt exist.

buzz.kerplouz.com (subdomain of www.kerplouz.com)have been created in a registar and go to my public ip adress of the sme server.

Buzz.kerplouz.com is also the domain name of the sme server (during the installation).

Sorry not to be very clear but even I am lost ...

http://buzz.kerplouz.com/
https://buzz.kerplouz.com/webftp/
https://buzz.kerplouz.com/roundcube/
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: DanB35 on November 19, 2016, 01:59:54 PM
http://www.buzz.kerplouz.com/ does'nt exist.
No, it doesn't.  But your SME server thinks it does and is requesting a certificate for it.  Again, what's the output of 'db hosts show www.buzz.kerplouz.com'?
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: john56 on November 19, 2016, 02:13:43 PM
db hosts show and db domains show :

http://pastebin.com/UQA33M6K
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: DanB35 on November 19, 2016, 02:17:33 PM
Code: [Select]
www.buzz.kerplouz.com=host
    ExternalIP=
    HostType=Self
    InternalIP=
    MACAddress=
    letsencryptSSLcert=enabled

There's your problem--your system is trying to get a cert for www.buzz.kerplouz.com because you told it to.  Run 'db hosts delprop www.buzz.kerplouz.com letsencryptSSLcert'; 'signal-event console-save', then try obtaining the cert again.
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: john56 on November 19, 2016, 02:24:44 PM
It looks great !  Many thanks !  (can you try ?)
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: DanB35 on November 19, 2016, 02:30:15 PM
Yep, it's up and running using the Let's Encrypt cert.
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: john56 on November 19, 2016, 02:33:21 PM
thanks !  I need to do dehydrated -c every 3 months, is that right ?
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: DanB35 on November 19, 2016, 02:40:31 PM
If you're using John Crisp's contrib, it should have that running daily by default--check to see that /etc/cron.daily/letsencrypt is present.  Running daily is not a problem--it will run, check your existing cert, and if your existing cert has more than 30 days' validity remaining, it will exit and do nothing.  When the cert has less than 30 days left, it will automatically renew it and reload all your system's services to use the new cert.
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: john56 on November 19, 2016, 02:42:57 PM
You are right DanB35.  Many thanks and have a good week end !
Title: Re: Error NXDomain with Letltsencrypt / Install with John Crisp contrib
Post by: ReetP on November 20, 2016, 12:49:19 PM
Thanks for doing the support guys !