mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
shared/tls: Add EAB support to RunACMEChallenge
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
parent
e6a84950a3
commit
3caced2ae5
@ -33,9 +33,16 @@ func CertificateNeedsUpdate(domain string, cert *x509.Certificate, threshold tim
|
||||
}
|
||||
|
||||
// RunACMEChallenge runs an ACME challenge to fetch updated certificates with `lego`.
|
||||
func RunACMEChallenge(ctx context.Context, dir, caURL, domain, email, challengeType, provider, port, proxy string, resolvers, environment []string) ([]byte, []byte, error) {
|
||||
func RunACMEChallenge(ctx context.Context, dir, caURL, domain, email, challengeType, provider, port, proxy, eabKid, eabHmac string, resolvers, environment []string) ([]byte, []byte, error) {
|
||||
env := os.Environ()
|
||||
|
||||
// Pass External Account Binding details through environment variables as
|
||||
// those are handled identically by both lego v4 and v5 and keep the HMAC
|
||||
// key off the command line.
|
||||
if eabKid != "" && eabHmac != "" {
|
||||
env = append(env, "LEGO_EAB=true", "LEGO_EAB_KID="+eabKid, "LEGO_EAB_HMAC="+eabHmac)
|
||||
}
|
||||
|
||||
// Detect the installed lego command line interface as it changed in lego v5.
|
||||
//
|
||||
// Lego v5 broke its CLI backward compatibility by moving some flags
|
||||
|
||||
Loading…
Reference in New Issue
Block a user