From 523f3eb25096d3dd2f568fe6421f3ac5d949ce97 Mon Sep 17 00:00:00 2001 From: xenolf Date: Sun, 27 Dec 2015 18:56:36 +0100 Subject: [PATCH] Change SetHTTPSPort to SetTLSPort --- acme/client.go | 14 ++++++++------ cli_handlers.go | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/acme/client.go b/acme/client.go index 80105ae1..b00a8656 100644 --- a/acme/client.go +++ b/acme/client.go @@ -105,14 +105,16 @@ func NewClient(caDirURL string, user User, keyBits int) (*Client, error) { // SetHTTPPort specifies a custom port to be used for HTTP based challenges. func (c *Client) SetHTTPPort(port string) { - /*if chlng, ok := c.solvers["http-01"]; ok { - }*/ + if chlng, ok := c.solvers["http-01"]; ok { + chlng.(*httpChallenge).optPort = port + } } -// SetHTTPSPort specifies a custom port to be used for HTTPS based challenges. -func (c *Client) SetHTTPSPort(port string) { - /*if chlng, ok := c.solvers["tls-sni-01"]; ok { - }*/ +// SetTLSPort specifies a custom port to be used for TLS based challenges. +func (c *Client) SetTLSPort(port string) { + if chlng, ok := c.solvers["tls-sni-01"]; ok { + chlng.(*tlsSNIChallenge).optPort = port + } } // ExcludeChallenges explicitly removes challenges from the pool for solving. diff --git a/cli_handlers.go b/cli_handlers.go index b97336ad..f6996aaa 100644 --- a/cli_handlers.go +++ b/cli_handlers.go @@ -48,7 +48,7 @@ func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) { } if c.GlobalIsSet("tlsPort") { - client.SetHTTPPort(c.GlobalString("tlsPort")) + client.SetTLSPort(c.GlobalString("tlsPort")) } return conf, acc, client