ericchiang / go-acme

A Let's Encrypt client for Go
Apache License 2.0
219 stars 14 forks source link

Added DNS Challenge support and travis-ci integration #16

Closed jameshartig closed 8 years ago

jameshartig commented 8 years ago

I added a .travis.yml so PRs and master can be built in Travis CI. It was pretty complicated since it has to build and start boulder but after a lot of trial and error I got it working. I couldn't test the final push since the import paths are wrong (github.com/ericchiang/letsencrypt vs github.com/levenlabs/letsencrypt) but if you turn on Travis CI support we can make sure this PR passes.

I also added DNS challenge support. This required that I included github.com/miekg/dns package in godeps so that breaks the diff :disappointed: so I moved that out into a separate commit so you can review the travis and dns commits separately.

I also added:

if chal.Type == ChallengeDNS {
    // unauthorized is the TXT value is wrong or not found
    // connection if NXDOMAIN
    if chal.Error.Typ == "urn:acme:error:unauthorized" || chal.Error.Typ == "urn:acme:error:connection" {
        time.Sleep(pollInterval)
        continue
    }
}

to the ChallengeReady loop since if you're using DNS, the old value or the non-existent value might be cached, so it will continue looping as long as the error is one of those. Let me know what you think.

Fixes #2

jameshartig commented 8 years ago

I'm going to open a new one so I can keep the replaced import paths in our master branch.