aboutsummaryrefslogtreecommitdiff
path: root/solve_tls.go
diff options
context:
space:
mode:
Diffstat (limited to 'solve_tls.go')
-rw-r--r--solve_tls.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/solve_tls.go b/solve_tls.go
index 36bbf11..c5e5fed 100644
--- a/solve_tls.go
+++ b/solve_tls.go
@@ -3,10 +3,8 @@ package acme
import (
"crypto/rand"
"crypto/rsa"
- "crypto/sha256"
"crypto/tls"
"crypto/x509"
- "encoding/hex"
"errors"
"log"
"math/big"
@@ -30,7 +28,7 @@ func (s *tlsSolver) getCert(h *tls.ClientHelloInfo) (*tls.Certificate, error) {
func NewTLSSolver(addr string) (Solver, error) {
// we need at least one cert
- dummy, err := newCert(sniName(""))
+ dummy, err := newCert("dummy" + AcmeInvalid)
if err != nil {
return nil, err
}
@@ -84,14 +82,8 @@ func newCert(domain string) (tls.Certificate, error) {
}, nil
}
-func sniName(keyAuth string) string {
- hash := sha256.Sum256([]byte(keyAuth))
- z := hex.EncodeToString(hash[:])
- return z[:32] + "." + z[32:] + ".acme.invalid"
-}
-
func (s *tlsSolver) Solve(ch Challenge) error {
- name := sniName(ch.KeyAuthorization)
+ name := ch.SNIName()
log.Println("solve tls", name)
crt, err := newCert(name)
if err != nil {