Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

efficientip: add insecure skip verify option #2052

Merged
merged 4 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/zz_gen_cmd_dnshelp.go
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@ func displayDNSHelp(w io.Writer, name string) error {

ew.writeln(`Additional Configuration:`)
ew.writeln(` - "EFFICIENTIP_HTTP_TIMEOUT": API request timeout`)
ew.writeln(` - "EFFICIENTIP_INSECURE_SKIP_VERIFY": Whether or not to verify EfficientIP API certificate`)
ew.writeln(` - "EFFICIENTIP_POLLING_INTERVAL": Time between DNS propagation check`)
ew.writeln(` - "EFFICIENTIP_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation`)
ew.writeln(` - "EFFICIENTIP_TTL": The TTL of the TXT record used for the DNS challenge`)
Expand Down
1 change: 1 addition & 0 deletions docs/content/dns/zz_gen_efficientip.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ More information [here]({{< ref "dns#configuration-and-credentials" >}}).
| Environment Variable Name | Description |
|--------------------------------|-------------|
| `EFFICIENTIP_HTTP_TIMEOUT` | API request timeout |
| `EFFICIENTIP_INSECURE_SKIP_VERIFY` | Whether or not to verify EfficientIP API certificate |
| `EFFICIENTIP_POLLING_INTERVAL` | Time between DNS propagation check |
| `EFFICIENTIP_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation |
| `EFFICIENTIP_TTL` | The TTL of the TXT record used for the DNS challenge |
Expand Down
10 changes: 10 additions & 0 deletions providers/dns/efficientip/efficientip.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package efficientip

import (
"context"
"crypto/tls"
"errors"
"fmt"
"net/http"
Expand All @@ -26,6 +27,7 @@ const (
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
EnvInsecureSkipVerify = envNamespace + "INSECURE_SKIP_VERIFY"
)

// Config is used to configure the creation of the DNSProvider.
Expand All @@ -35,6 +37,7 @@ type Config struct {
Hostname string
DNSName string
ViewName string
InsecureSkipVerify bool
PropagationTimeout time.Duration
PollingInterval time.Duration
HTTPClient *http.Client
Expand Down Expand Up @@ -71,6 +74,7 @@ func NewDNSProvider() (*DNSProvider, error) {
config.Hostname = values[EnvHostname]
config.DNSName = values[EnvDNSName]
config.ViewName = env.GetOrDefaultString(EnvViewName, "")
config.InsecureSkipVerify = env.GetOrDefaultBool(EnvInsecureSkipVerify, false)

return NewDNSProviderConfig(config)
}
Expand Down Expand Up @@ -100,6 +104,12 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
client.HTTPClient = config.HTTPClient
}

if config.InsecureSkipVerify {
client.HTTPClient.Transport = &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
}

return &DNSProvider{config: config, client: client}, nil
}

Expand Down
1 change: 1 addition & 0 deletions providers/dns/efficientip/efficientip.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ lego --email [email protected] --dns efficientip --domains my.example.org run
EFFICIENTIP_HOSTNAME = "Hostname (ex: foo.example.com)"
EFFICIENTIP_DNS_NAME = "DNS name (ex: dns.smart)"
[Configuration.Additional]
EFFICIENTIP_INSECURE_SKIP_VERIFY = "Whether or not to verify EfficientIP API certificate"
EFFICIENTIP_VIEW_NAME = "View name (ex: external)"
EFFICIENTIP_POLLING_INTERVAL = "Time between DNS propagation check"
EFFICIENTIP_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"
Expand Down