Skip to content

Commit 7186ebb

Browse files
alexissavinldez
andauthored
efficientip: add insecure skip verify option (#2052)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 5af3c6c commit 7186ebb

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

cmd/zz_gen_cmd_dnshelp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,7 @@ func displayDNSHelp(w io.Writer, name string) error {
964964

965965
ew.writeln(`Additional Configuration:`)
966966
ew.writeln(` - "EFFICIENTIP_HTTP_TIMEOUT": API request timeout`)
967+
ew.writeln(` - "EFFICIENTIP_INSECURE_SKIP_VERIFY": Whether or not to verify EfficientIP API certificate`)
967968
ew.writeln(` - "EFFICIENTIP_POLLING_INTERVAL": Time between DNS propagation check`)
968969
ew.writeln(` - "EFFICIENTIP_PROPAGATION_TIMEOUT": Maximum waiting time for DNS propagation`)
969970
ew.writeln(` - "EFFICIENTIP_TTL": The TTL of the TXT record used for the DNS challenge`)

docs/content/dns/zz_gen_efficientip.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ More information [here]({{< ref "dns#configuration-and-credentials" >}}).
5454
| Environment Variable Name | Description |
5555
|--------------------------------|-------------|
5656
| `EFFICIENTIP_HTTP_TIMEOUT` | API request timeout |
57+
| `EFFICIENTIP_INSECURE_SKIP_VERIFY` | Whether or not to verify EfficientIP API certificate |
5758
| `EFFICIENTIP_POLLING_INTERVAL` | Time between DNS propagation check |
5859
| `EFFICIENTIP_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation |
5960
| `EFFICIENTIP_TTL` | The TTL of the TXT record used for the DNS challenge |

providers/dns/efficientip/efficientip.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package efficientip
33

44
import (
55
"context"
6+
"crypto/tls"
67
"errors"
78
"fmt"
89
"net/http"
@@ -26,6 +27,7 @@ const (
2627
EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
2728
EnvPollingInterval = envNamespace + "POLLING_INTERVAL"
2829
EnvHTTPTimeout = envNamespace + "HTTP_TIMEOUT"
30+
EnvInsecureSkipVerify = envNamespace + "INSECURE_SKIP_VERIFY"
2931
)
3032

3133
// Config is used to configure the creation of the DNSProvider.
@@ -35,6 +37,7 @@ type Config struct {
3537
Hostname string
3638
DNSName string
3739
ViewName string
40+
InsecureSkipVerify bool
3841
PropagationTimeout time.Duration
3942
PollingInterval time.Duration
4043
HTTPClient *http.Client
@@ -71,6 +74,7 @@ func NewDNSProvider() (*DNSProvider, error) {
7174
config.Hostname = values[EnvHostname]
7275
config.DNSName = values[EnvDNSName]
7376
config.ViewName = env.GetOrDefaultString(EnvViewName, "")
77+
config.InsecureSkipVerify = env.GetOrDefaultBool(EnvInsecureSkipVerify, false)
7478

7579
return NewDNSProviderConfig(config)
7680
}
@@ -100,6 +104,12 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
100104
client.HTTPClient = config.HTTPClient
101105
}
102106

107+
if config.InsecureSkipVerify {
108+
client.HTTPClient.Transport = &http.Transport{
109+
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
110+
}
111+
}
112+
103113
return &DNSProvider{config: config, client: client}, nil
104114
}
105115

providers/dns/efficientip/efficientip.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ lego --email [email protected] --dns efficientip --domains my.example.org run
1919
EFFICIENTIP_HOSTNAME = "Hostname (ex: foo.example.com)"
2020
EFFICIENTIP_DNS_NAME = "DNS name (ex: dns.smart)"
2121
[Configuration.Additional]
22+
EFFICIENTIP_INSECURE_SKIP_VERIFY = "Whether or not to verify EfficientIP API certificate"
2223
EFFICIENTIP_VIEW_NAME = "View name (ex: external)"
2324
EFFICIENTIP_POLLING_INTERVAL = "Time between DNS propagation check"
2425
EFFICIENTIP_PROPAGATION_TIMEOUT = "Maximum waiting time for DNS propagation"

0 commit comments

Comments
 (0)