mirror of
https://github.com/rancher/rke.git
synced 2025-08-15 05:24:32 +00:00
Use constant instead of value for cert duration
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
This commit is contained in:
parent
cd232294cc
commit
9ce38db012
@ -149,7 +149,7 @@ func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS
|
|||||||
CommonName: fmt.Sprintf("%s-ca@%d", host, time.Now().Unix()),
|
CommonName: fmt.Sprintf("%s-ca@%d", host, time.Now().Unix()),
|
||||||
},
|
},
|
||||||
NotBefore: time.Now(),
|
NotBefore: time.Now(),
|
||||||
NotAfter: time.Now().Add(time.Hour * 24 * 365),
|
NotAfter: time.Now().Add(duration365d),
|
||||||
|
|
||||||
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
|
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
@ -177,7 +177,7 @@ func GenerateSelfSignedCertKey(host string, alternateIPs []net.IP, alternateDNS
|
|||||||
CommonName: fmt.Sprintf("%s@%d", host, time.Now().Unix()),
|
CommonName: fmt.Sprintf("%s@%d", host, time.Now().Unix()),
|
||||||
},
|
},
|
||||||
NotBefore: time.Now(),
|
NotBefore: time.Now(),
|
||||||
NotAfter: time.Now().Add(time.Hour * 24 * 365),
|
NotAfter: time.Now().Add(duration365d),
|
||||||
|
|
||||||
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
|
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
|
||||||
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
|
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
|
||||||
|
Loading…
Reference in New Issue
Block a user