aboutsummaryrefslogtreecommitdiff
path: root/doc.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2020-10-28 16:02:04 -0400
committerAdnan Maolood <[email protected]>2020-10-28 16:02:04 -0400
commitb5fbd197a15e6991552c48f401206ead0501b52d (patch)
tree5f69fc679f8eee9a92dcd6ca11b2651024609a9f /doc.go
parentUse strings.Builder in Fingerprint (diff)
downloadgo-gemini-b5fbd197a15e6991552c48f401206ead0501b52d.tar.xz
go-gemini-b5fbd197a15e6991552c48f401206ead0501b52d.zip
Update documentation
Diffstat (limited to 'doc.go')
-rw-r--r--doc.go24
1 files changed, 7 insertions, 17 deletions
diff --git a/doc.go b/doc.go
index 3c97595..f0d3fdb 100644
--- a/doc.go
+++ b/doc.go
@@ -41,22 +41,12 @@ Clients can control when to trust certificates with TrustCertificate:
return knownHosts.Lookup(hostname, cert)
}
-Clients can control what to do when a server requests a certificate:
-
- client.GetCertificate = func(hostname string, store *gemini.CertificateStore) *tls.Certificate {
- // If the certificate is in the store, return it
- if cert, err := store.Lookup(hostname); err == nil {
- return &cert
- }
- // Otherwise, generate a certificate
- duration := time.Hour
- cert, err := gemini.NewCertificate(hostname, duration)
- if err != nil {
- return nil
- }
- // Store and return the certificate
- store.Add(hostname, cert)
- return &cert
+Clients can create client certificates upon the request of a server:
+
+ client.CreateCertificate = func(hostname, path string) *tls.Certificate {
+ return gemini.CreateCertificate(gemini.CertificateOptions{
+ Duration: time.Hour,
+ })
}
Server is a Gemini server.
@@ -65,7 +55,7 @@ Server is a Gemini server.
Servers must be configured with certificates:
- err := server.CertificateStore.Load("/var/lib/gemini/certs")
+ err := server.Certificates.Load("/var/lib/gemini/certs")
if err != nil {
// handle error
}