Update documentation
This commit is contained in:
@@ -51,7 +51,13 @@ type Client struct {
|
|||||||
|
|
||||||
// TrustCertificate is called to determine whether the client
|
// TrustCertificate is called to determine whether the client
|
||||||
// should trust a certificate it has not seen before.
|
// should trust a certificate it has not seen before.
|
||||||
// If TrustCertificate is nil, the certificate will not be trusted.
|
// If TrustCertificate is nil, the certificate will not be trusted
|
||||||
|
// and the connection will be aborted.
|
||||||
|
//
|
||||||
|
// If TrustCertificate returns TrustOnce, the certificate will be added
|
||||||
|
// to the client's list of known hosts.
|
||||||
|
// If TrustCertificate returns TrustAlways, the certificate will also be
|
||||||
|
// written to the known hosts file.
|
||||||
TrustCertificate func(hostname string, cert *x509.Certificate) Trust
|
TrustCertificate func(hostname string, cert *x509.Certificate) Trust
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
6
doc.go
6
doc.go
@@ -37,8 +37,8 @@ Clients can load their own list of known hosts:
|
|||||||
|
|
||||||
Clients can control when to trust certificates with TrustCertificate:
|
Clients can control when to trust certificates with TrustCertificate:
|
||||||
|
|
||||||
client.TrustCertificate = func(hostname string, cert *x509.Certificate, knownHosts *gemini.KnownHosts) error {
|
client.TrustCertificate = func(hostname string, cert *x509.Certificate) gemini.Trust {
|
||||||
return knownHosts.Lookup(hostname, cert)
|
return gemini.TrustOnce
|
||||||
}
|
}
|
||||||
|
|
||||||
Clients can create client certificates upon the request of a server:
|
Clients can create client certificates upon the request of a server:
|
||||||
@@ -53,7 +53,7 @@ Server is a Gemini server.
|
|||||||
|
|
||||||
var server gemini.Server
|
var server gemini.Server
|
||||||
|
|
||||||
Servers must be configured with certificates:
|
Servers should be configured with certificates:
|
||||||
|
|
||||||
err := server.Certificates.Load("/var/lib/gemini/certs")
|
err := server.Certificates.Load("/var/lib/gemini/certs")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user