Skip to content

Commit

Permalink
Merge pull request #60 from akakou/hotfix/acme-miss
Browse files Browse the repository at this point in the history
Hotfix/acme miss
  • Loading branch information
akakou authored May 6, 2024
2 parents 7d28120 + 9ad9f2d commit 39789b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
16 changes: 1 addition & 15 deletions ta/acme.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"fmt"
"log"

"github.com/go-acme/lego/v4/certcrypto"
"github.com/go-acme/lego/v4/certificate"
"github.com/go-acme/lego/v4/challenge/http01"
"github.com/go-acme/lego/v4/challenge/tlsalpn01"
"github.com/go-acme/lego/v4/lego"
"github.com/go-acme/lego/v4/registration"
Expand Down Expand Up @@ -56,15 +54,7 @@ func IssueCertificate(key crypto.PrivateKey, domain, email string) *certificate.
log.Fatal(err)
}

// We specify an HTTP port of 5002 and an TLS port of 5001 on all interfaces
// because we aren't running as root and can't bind a listener to port 80 and 443
// (used later when we attempt to pass challenges). Keep in mind that you still
// need to proxy challenge traffic to port 5002 and 5001.
err = client.Challenge.SetHTTP01Provider(http01.NewProviderServer("", "5002"))
if err != nil {
log.Fatal(err)
}
err = client.Challenge.SetTLSALPN01Provider(tlsalpn01.NewProviderServer("", "5001"))
client.Challenge.SetTLSALPN01Provider(tlsalpn01.NewProviderServer("", "443"))
if err != nil {
log.Fatal(err)
}
Expand All @@ -86,9 +76,5 @@ func IssueCertificate(key crypto.PrivateKey, domain, email string) *certificate.
log.Fatal(err)
}

// Each certificate comes back with the cert bytes, the bytes of the client's
// private key, and a certificate URL. SAVE THESE TO DISK.
fmt.Printf("%#v\n", certificates)

return certificates
}
2 changes: 1 addition & 1 deletion ta/example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func main() {
return c.String(http.StatusOK, "Hello, World!")
})

e.Server.TLSConfig, err = ta.TLSConfig()
err = ta.Config(e)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 39789b8

Please sign in to comment.