aboutsummaryrefslogtreecommitdiff
path: root/examples/server.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-20 18:30:49 -0500
committerAdnan Maolood <[email protected]>2021-02-20 18:30:49 -0500
commit0baa66a4e70a2302c044fbd9eb7ee4eb5e3bb03e (patch)
treeecae9eabd20c6691b79a34ecf62f5e7c25128617 /examples/server.go
parentcertificate.Store: Support "*" wildcard pattern (diff)
downloadgo-gemini-0baa66a4e70a2302c044fbd9eb7ee4eb5e3bb03e.tar.xz
go-gemini-0baa66a4e70a2302c044fbd9eb7ee4eb5e3bb03e.zip
Update examples
Diffstat (limited to 'examples/server.go')
-rw-r--r--examples/server.go14
1 files changed, 1 insertions, 13 deletions
diff --git a/examples/server.go b/examples/server.go
index 6e00f32..430da55 100644
--- a/examples/server.go
+++ b/examples/server.go
@@ -5,8 +5,6 @@
package main
import (
- "crypto/tls"
- "crypto/x509/pkix"
"log"
"os"
"time"
@@ -16,17 +14,7 @@ import (
)
func main() {
- certificates := &certificate.Store{
- CreateCertificate: func(hostname string) (tls.Certificate, error) {
- return certificate.Create(certificate.CreateOptions{
- Subject: pkix.Name{
- CommonName: hostname,
- },
- DNSNames: []string{hostname},
- Duration: 365 * 24 * time.Hour,
- })
- },
- }
+ certificates := &certificate.Store{}
certificates.Register("localhost")
if err := certificates.Load("/var/lib/gemini/certs"); err != nil {
log.Fatal(err)