mirror of
https://github.com/flant/ovpn-admin.git
synced 2026-02-04 01:10:22 -08:00
Apply review changes
Signed-off-by: Paramoshka <parfenov_ivan_42a@mail.ru>
This commit is contained in:
parent
67b7e50964
commit
6bd2e0c063
@ -132,11 +132,11 @@ func genServerCert(privKey, caPrivKey *rsa.PrivateKey, ca *x509.Certificate, cn
|
||||
// return PEM encoded certificate
|
||||
func genClientCert(privKey, caPrivKey *rsa.PrivateKey, ca *x509.Certificate, cn string) (issuerPEM *bytes.Buffer, err error) {
|
||||
serialNumberRange := new(big.Int).Lsh(big.NewInt(1), 128)
|
||||
serial, _ := rand.Int(rand.Reader, serialNumberRange)
|
||||
serial, err := rand.Int(rand.Reader, serialNumberRange)
|
||||
|
||||
certLifetimeDays, err := strconv.Atoi(*clientCertExpirationDays)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't get cert expired value: %w", err)
|
||||
return nil, fmt.Errorf("can't get client certificate expiration value: %w", err)
|
||||
}
|
||||
|
||||
notBefore := time.Now()
|
||||
|
||||
2
main.go
2
main.go
@ -75,7 +75,7 @@ var (
|
||||
logLevel = kingpin.Flag("log.level", "set log level: trace, debug, info, warn, error (default info)").Default("info").Envar("LOG_LEVEL").String()
|
||||
logFormat = kingpin.Flag("log.format", "set log format: text, json (default text)").Default("text").Envar("LOG_FORMAT").String()
|
||||
storageBackend = kingpin.Flag("storage.backend", "storage backend: filesystem, kubernetes.secrets (default filesystem)").Default("filesystem").Envar("STORAGE_BACKEND").String()
|
||||
clientCertExpirationDays = kingpin.Flag("easyrsa.client-cert.expired", "Certificate client expired period for OpenVPN in days, the period will shrink automatically to CA expirition period").Default("3650").Envar("CLIENT_CERT_EXPIRE").String()
|
||||
clientCertExpirationDays = kingpin.Flag("client-cert.expiration-days", "Expiration period of OpenVPN client certificates in days, the period will shrink automatically to the CA expiration period").Default("3650").Envar("CLIENT_CERT_EXPIRATION_DAYS").String()
|
||||
|
||||
certsArchivePath = "/tmp/" + certsArchiveFileName
|
||||
ccdArchivePath = "/tmp/" + ccdArchiveFileName
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user