mirror of
https://github.com/go-acme/lego
synced 2026-03-14 14:35:48 +01:00
feat(lib): disable Common Name by default
This commit is contained in:
parent
218ec2c138
commit
0ebf28c9a8
4 changed files with 5 additions and 5 deletions
|
|
@ -126,7 +126,7 @@ type CertifierOptions struct {
|
|||
KeyType certcrypto.KeyType
|
||||
Timeout time.Duration
|
||||
OverallRequestLimit int
|
||||
DisableCommonName bool
|
||||
EnableCommonName bool
|
||||
}
|
||||
|
||||
// Certifier A service to obtain/renew/revoke certificates.
|
||||
|
|
@ -305,7 +305,7 @@ func (c *Certifier) getForOrder(ctx context.Context, domains []string, order acm
|
|||
}
|
||||
|
||||
commonName := ""
|
||||
if len(domains[0]) <= 64 && !c.options.DisableCommonName {
|
||||
if len(domains[0]) <= 64 && c.options.EnableCommonName {
|
||||
commonName = domains[0]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ func newClient(ctx *cli.Context, acc registration.User, keyType certcrypto.KeyTy
|
|||
KeyType: keyType,
|
||||
Timeout: time.Duration(ctx.Int(flgCertTimeout)) * time.Second,
|
||||
OverallRequestLimit: ctx.Int(flgOverallRequestLimit),
|
||||
DisableCommonName: ctx.Bool(flgDisableCommonName),
|
||||
EnableCommonName: !ctx.Bool(flgDisableCommonName),
|
||||
}
|
||||
config.UserAgent = getUserAgent(ctx)
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ func NewClient(config *Config) (*Client, error) {
|
|||
KeyType: config.Certificate.KeyType,
|
||||
Timeout: config.Certificate.Timeout,
|
||||
OverallRequestLimit: config.Certificate.OverallRequestLimit,
|
||||
DisableCommonName: config.Certificate.DisableCommonName,
|
||||
EnableCommonName: config.Certificate.EnableCommonName,
|
||||
}
|
||||
|
||||
certifier := certificate.NewCertifier(core, prober, options)
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ type CertificateConfig struct {
|
|||
KeyType certcrypto.KeyType
|
||||
Timeout time.Duration
|
||||
OverallRequestLimit int
|
||||
DisableCommonName bool
|
||||
EnableCommonName bool
|
||||
}
|
||||
|
||||
// createDefaultHTTPClient Creates an HTTP client with a reasonable timeout value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue