mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 07:12:27 +00:00
This commit is contained in:
parent
31559e908b
commit
846b265430
@ -99,12 +99,15 @@ func NewCertificate(certFile, keyFile, commonName string, lifetimeDays int) (tls
|
|||||||
notBefore := time.Now().Truncate(24 * time.Hour)
|
notBefore := time.Now().Truncate(24 * time.Hour)
|
||||||
notAfter := notBefore.Add(time.Duration(lifetimeDays*24) * time.Hour)
|
notAfter := notBefore.Add(time.Duration(lifetimeDays*24) * time.Hour)
|
||||||
|
|
||||||
// NOTE: update checkExpiry() appropriately if you add or change attributes
|
// NOTE: update lib/api.shouldRegenerateCertificate() appropriately if
|
||||||
// in here, especially DNSNames or IPAddresses.
|
// you add or change attributes in here, especially DNSNames or
|
||||||
|
// IPAddresses.
|
||||||
template := x509.Certificate{
|
template := x509.Certificate{
|
||||||
SerialNumber: new(big.Int).SetUint64(rand.Uint64()),
|
SerialNumber: new(big.Int).SetUint64(rand.Uint64()),
|
||||||
Subject: pkix.Name{
|
Subject: pkix.Name{
|
||||||
CommonName: commonName,
|
CommonName: commonName,
|
||||||
|
Organization: []string{"Syncthing"},
|
||||||
|
OrganizationalUnit: []string{"Automatically Generated"},
|
||||||
},
|
},
|
||||||
DNSNames: []string{commonName},
|
DNSNames: []string{commonName},
|
||||||
NotBefore: notBefore,
|
NotBefore: notBefore,
|
||||||
|
Loading…
Reference in New Issue
Block a user