mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-01-19 00:57:53 +00:00
Run gofmt
This commit is contained in:
parent
fedfa8def4
commit
a48ba8ee49
1 changed files with 8 additions and 8 deletions
|
@ -311,7 +311,7 @@ func obtainCert(acmeClient *lego.Client, domains []string, renew *certificate.Re
|
||||||
tlsCertificate, err := tls.X509KeyPair(renew.Certificate, renew.PrivateKey)
|
tlsCertificate, err := tls.X509KeyPair(renew.Certificate, renew.PrivateKey)
|
||||||
if err == nil && tlsCertificate.Leaf.NotAfter.After(time.Now()) {
|
if err == nil && tlsCertificate.Leaf.NotAfter.After(time.Now()) {
|
||||||
// avoid sending a mock cert instead of a still valid cert, instead abuse CSR field to store time to try again at
|
// avoid sending a mock cert instead of a still valid cert, instead abuse CSR field to store time to try again at
|
||||||
renew.CSR = []byte(strconv.FormatInt(time.Now().Add(6 * time.Hour).Unix(), 10))
|
renew.CSR = []byte(strconv.FormatInt(time.Now().Add(6*time.Hour).Unix(), 10))
|
||||||
PogrebPut(keyDatabase, []byte(name), renew)
|
PogrebPut(keyDatabase, []byte(name), renew)
|
||||||
return tlsCertificate, nil
|
return tlsCertificate, nil
|
||||||
}
|
}
|
||||||
|
@ -349,7 +349,7 @@ func mockCert(domain string, msg string) tls.Certificate {
|
||||||
},
|
},
|
||||||
|
|
||||||
// certificates younger than 7 days are renewed, so this enforces the cert to not be renewed for a 6 hours
|
// certificates younger than 7 days are renewed, so this enforces the cert to not be renewed for a 6 hours
|
||||||
NotAfter: time.Now().Add(time.Hour * 24 * 7 + time.Hour * 6),
|
NotAfter: time.Now().Add(time.Hour*24*7 + time.Hour*6),
|
||||||
NotBefore: time.Now(),
|
NotBefore: time.Now(),
|
||||||
|
|
||||||
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
|
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
|
||||||
|
@ -383,7 +383,7 @@ func mockCert(domain string, msg string) tls.Certificate {
|
||||||
Domain: domain,
|
Domain: domain,
|
||||||
}
|
}
|
||||||
databaseName := domain
|
databaseName := domain
|
||||||
if domain == "*" + string(MainDomainSuffix) || domain == string(MainDomainSuffix[1:]) {
|
if domain == "*"+string(MainDomainSuffix) || domain == string(MainDomainSuffix[1:]) {
|
||||||
databaseName = string(MainDomainSuffix)
|
databaseName = string(MainDomainSuffix)
|
||||||
}
|
}
|
||||||
PogrebPut(keyDatabase, []byte(databaseName), res)
|
PogrebPut(keyDatabase, []byte(databaseName), res)
|
||||||
|
|
Loading…
Reference in a new issue