Remove devMode from library and cli.

This commit is contained in:
xenolf 2015-10-26 00:47:37 +01:00
parent 8d31bb0123
commit 8b16d59831
3 changed files with 3 additions and 8 deletions

View file

@ -47,7 +47,6 @@ type Client struct {
user User user User
jws *jws jws *jws
keyBits int keyBits int
devMode bool
issuerCert []byte issuerCert []byte
solvers map[string]solver solvers map[string]solver
} }
@ -57,7 +56,7 @@ type Client struct {
// usr - A filled in user struct // usr - A filled in user struct
// optPort - The alternative port to listen on for challenges. // optPort - The alternative port to listen on for challenges.
// devMode - If set to true, all CanSolve() checks are skipped. // devMode - If set to true, all CanSolve() checks are skipped.
func NewClient(caURL string, usr User, keyBits int, optPort string, devMode bool) *Client { func NewClient(caURL string, usr User, keyBits int, optPort string) *Client {
if err := usr.GetPrivateKey().Validate(); err != nil { if err := usr.GetPrivateKey().Validate(); err != nil {
logger().Fatalf("Could not validate the private account key of %s\n\t%v", usr.GetEmail(), err) logger().Fatalf("Could not validate the private account key of %s\n\t%v", usr.GetEmail(), err)
} }
@ -85,7 +84,7 @@ func NewClient(caURL string, usr User, keyBits int, optPort string, devMode bool
logger().Fatal("The directory returned by the server was invalid.") logger().Fatal("The directory returned by the server was invalid.")
} }
return &Client{directory: dir, user: usr, jws: jws, keyBits: keyBits, devMode: devMode, solvers: solvers} return &Client{directory: dir, user: usr, jws: jws, keyBits: keyBits, solvers: solvers}
} }
// Register the current account to the ACME server. // Register the current account to the ACME server.

4
cli.go
View file

@ -85,10 +85,6 @@ func main() {
Name: "port", Name: "port",
Usage: "Challenges will use this port to listen on. Please make sure to forward port 443 to this port on your machine. Otherwise use setcap on the binary", Usage: "Challenges will use this port to listen on. Please make sure to forward port 443 to this port on your machine. Otherwise use setcap on the binary",
}, },
cli.BoolFlag{
Name: "devMode",
Usage: "If set to true, all client side challenge pre-tests are skipped.",
},
} }
app.Run(os.Args) app.Run(os.Args)

View file

@ -32,7 +32,7 @@ func setup(c *cli.Context) (*Configuration, *Account, *acme.Client) {
//TODO: move to account struct? Currently MUST pass email. //TODO: move to account struct? Currently MUST pass email.
acc := NewAccount(c.GlobalString("email"), conf) acc := NewAccount(c.GlobalString("email"), conf)
return conf, acc, acme.NewClient(c.GlobalString("server"), acc, conf.RsaBits(), conf.OptPort(), c.GlobalBool("devMode")) return conf, acc, acme.NewClient(c.GlobalString("server"), acc, conf.RsaBits(), conf.OptPort())
} }
func saveCertRes(certRes acme.CertificateResource, conf *Configuration) { func saveCertRes(certRes acme.CertificateResource, conf *Configuration) {