Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnknownSSLMode is returned for an SSLMode value outside the supported set. ErrUnknownSSLMode = errors.New("unknown ssl mode") // ErrNoRootCert is returned when an ssl_root_cert file contains no usable // PEM certificates. ErrNoRootCert = errors.New("ssl root cert contains no valid PEM certificates") // ErrNoPeerCert is returned when the server completes a handshake without // presenting any certificate (only reachable in the verify modes). ErrNoPeerCert = errors.New("server presented no certificates") )
Functions ¶
func Config ¶
Config translates a config.SSLMode into a *tls.Config for a network database driver. A nil result means TLS is disabled and the caller should connect over plaintext. serverName is the host used for verify-full hostname matching and may be empty for the non-verifying modes.
- disable (and the empty default): nil, nil — plaintext.
- require: encryption only, no certificate or hostname verification.
- verify-ca: verify the certificate chains to a trusted CA, skip hostname.
- verify-full: verify the CA chain and that the certificate matches serverName.
rootCertPath optionally points at a PEM CA bundle used by the verify modes; when empty the host system pool is used.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.