Skip to content

Commit

Permalink
Fix config typo
Browse files Browse the repository at this point in the history
  • Loading branch information
hdecarne committed Oct 27, 2024
1 parent 8e0a470 commit e7acd7a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions certs/acme.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func (factory *acmeCertificateFactory) New() (crypto.PrivateKey, *x509.Certifica
if factory.certificateRequest.Domain.Http01Challenge.Enabled {
client.Challenge.SetHTTP01Provider(http01.NewProviderServer(factory.certificateRequest.Domain.Http01Challenge.Iface, strconv.Itoa(factory.certificateRequest.Domain.Http01Challenge.Port)))
}
if factory.certificateRequest.Domain.TLSAPN01Challenge.Enabled {
client.Challenge.SetTLSALPN01Provider(tlsalpn01.NewProviderServer(factory.certificateRequest.Domain.TLSAPN01Challenge.Iface, strconv.Itoa(factory.certificateRequest.Domain.TLSAPN01Challenge.Port)))
if factory.certificateRequest.Domain.TLSALPN01Challenge.Enabled {
client.Challenge.SetTLSALPN01Provider(tlsalpn01.NewProviderServer(factory.certificateRequest.Domain.TLSALPN01Challenge.Iface, strconv.Itoa(factory.certificateRequest.Domain.TLSALPN01Challenge.Port)))
}
key, err := factory.keyPairFactory.New()
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions certs/acme/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
// enabled: true
// iface: ""
// port: 5002
// tls-apn-01:
// tls-alpn-01:
// enabled: true
// iface: ""
// port: 5001
Expand Down Expand Up @@ -147,7 +147,7 @@ func (providerConfig *ProviderConfig) newClientHelper(registrationFile *os.File,
return nil, fmt.Errorf("failed to create client for provider '%s' (cause: %w)", providerConfig.Name, err)
}
if !registration.isActive(client) {
err = registration.register(client, keyPairFactory)
err = registration.register(client)
if err != nil {
return nil, fmt.Errorf("failed to register client for provider '%s' (cause: %w)", providerConfig.Name, err)
}
Expand Down Expand Up @@ -183,7 +183,7 @@ type DomainConfig struct {
// Http01Challenge configures the HTTP-01 challenge type.
Http01Challenge Http01ChallengeConfig `yaml:"http-01"`
// Http01Challenge configures the TLS-ALPN-01 challenge type.
TLSAPN01Challenge TLSAPN01ChallengeConfig `yaml:"tls-apn-01"`
TLSALPN01Challenge TLSALPN01ChallengeConfig `yaml:"tls-alpn-01"`
}

// A Http01ChallengeConfig configures the HTTP-01 challenge type for domain validation.
Expand All @@ -196,7 +196,7 @@ type Http01ChallengeConfig struct {
Port int `ymal:"port"`
}

type TLSAPN01ChallengeConfig struct {
type TLSALPN01ChallengeConfig struct {
// Enabled defines wether this challenge type is used (true) or not (false).
Enabled bool `yaml:"enabled"`
// Iface sets the interface to listen on during domain verification (optional).
Expand Down
2 changes: 1 addition & 1 deletion certs/acme/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (providerRegistration *ProviderRegistration) isActive(client *lego.Client)
return err == nil
}

func (providerRegistration *ProviderRegistration) register(client *lego.Client, keyFactory keys.KeyPairFactory) error {
func (providerRegistration *ProviderRegistration) register(client *lego.Client) error {
options := registration.RegisterOptions{TermsOfServiceAgreed: true}
registrationResource, err := client.Registration.Register(options)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion certs/acme/testdata/acme-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ domains:
enabled: true
iface: ""
port: 5002
tls-apn-01:
tls-alpn-01:
enabled: true
iface: ""
port: 5001

0 comments on commit e7acd7a

Please sign in to comment.