aboutsummaryrefslogtreecommitdiff
path: root/certificate
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-03-05 23:29:53 -0500
committerAdnan Maolood <[email protected]>2021-03-05 23:29:56 -0500
commitd1cb8967b6bbecf01cd0a3f407f1beb9b9c7bcb8 (patch)
treed263000ec5040b58e83fa6b95eabcde4bca324b7 /certificate
parentMove LoggingMiddleware out of examples/server.go (diff)
downloadgo-gemini-d1cb8967b6bbecf01cd0a3f407f1beb9b9c7bcb8.tar.xz
go-gemini-d1cb8967b6bbecf01cd0a3f407f1beb9b9c7bcb8.zip
certificate.Store: Make 100 years the default duration
Diffstat (limited to 'certificate')
-rw-r--r--certificate/store.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/certificate/store.go b/certificate/store.go
index f5847b4..7d51ec3 100644
--- a/certificate/store.go
+++ b/certificate/store.go
@@ -101,7 +101,7 @@ func (s *Store) write(scope string, cert tls.Certificate) error {
// If no matching scope has been registered, Get returns an error.
// Get generates new certificates as needed and rotates expired certificates.
// It calls CreateCertificate to create a new certificate if it is not nil,
-// otherwise it creates certificates with a duration of 250 years.
+// otherwise it creates certificates with a duration of 100 years.
//
// Get is suitable for use in a gemini.Server's GetCertificate field.
func (s *Store) Get(hostname string) (*tls.Certificate, error) {
@@ -173,7 +173,7 @@ func (s *Store) createCertificate(scope string) (tls.Certificate, error) {
Subject: pkix.Name{
CommonName: scope,
},
- Duration: 250 * 365 * 24 * time.Hour,
+ Duration: 100 * 365 * 24 * time.Hour,
})
}