Exclude TLS ALPN for some CLI arguments (#599)

This commit is contained in:
Ludovic Fernandez 2018-07-16 22:50:51 +02:00 committed by GitHub
parent 771679fe3d
commit dd85f25cb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,7 @@ func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) {
}
if len(c.GlobalStringSlice("dns-resolvers")) > 0 {
resolvers := []string{}
var resolvers []string
for _, resolver := range c.GlobalStringSlice("dns-resolvers") {
if !strings.Contains(resolver, ":") {
resolver += ":53"
@ -92,7 +92,7 @@ func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) {
// --webroot=foo indicates that the user specifically want to do a HTTP challenge
// infer that the user also wants to exclude all other challenges
client.ExcludeChallenges([]acme.Challenge{acme.DNS01})
client.ExcludeChallenges([]acme.Challenge{acme.DNS01, acme.TLSALPN01})
}
if c.GlobalIsSet("memcached-host") {
provider, err := memcached.NewMemcachedProvider(c.GlobalStringSlice("memcached-host"))
@ -107,7 +107,7 @@ func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) {
// --memcached-host=foo:11211 indicates that the user specifically want to do a HTTP challenge
// infer that the user also wants to exclude all other challenges
client.ExcludeChallenges([]acme.Challenge{acme.DNS01})
client.ExcludeChallenges([]acme.Challenge{acme.DNS01, acme.TLSALPN01})
}
if c.GlobalIsSet("http") {
if !strings.Contains(c.GlobalString("http"), ":") {
@ -140,7 +140,7 @@ func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) {
// --dns=foo indicates that the user specifically want to do a DNS challenge
// infer that the user also wants to exclude all other challenges
client.ExcludeChallenges([]acme.Challenge{acme.HTTP01})
client.ExcludeChallenges([]acme.Challenge{acme.HTTP01, acme.TLSALPN01})
}
if client.GetExternalAccountRequired() && !c.GlobalIsSet("eab") {