Skip to content

Commit

Permalink
add http server to handle ACME challenges
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Nov 26, 2024
1 parent 168aef4 commit 45be7be
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/walletextension/walletextension_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package walletextension

import (
"crypto/tls"
"net/http"
"os"
"time"

Expand Down Expand Up @@ -78,6 +79,13 @@ func NewContainerFromConfig(config wecommon.Config, logger gethlog.Logger) *Cont
// Cache: autocert.DirCache("certs"), // TODO: We can add cache for certs (+ don't forget to include the directory in enclave.json)
}

// Create HTTP-01 challenge handler
httpServer := &http.Server{
Addr: ":http", // Port 80
Handler: certManager.HTTPHandler(nil),
}
go httpServer.ListenAndServe() // Start HTTP server for ACME challenges

tlsConfig := &tls.Config{
GetCertificate: certManager.GetCertificate,
MinVersion: tls.VersionTLS12,
Expand Down

0 comments on commit 45be7be

Please sign in to comment.