ssl

package
v3.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2019 License: Apache-2.0 Imports: 12 Imported by: 15 modules, 26 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendKeyPair

func AppendKeyPair(tlsConfig *tls.Config, certFile string, keyFile string) error

AppendKeyPair loads the given TLS key pair and appends it to tlsConfig.Certificates.

func AppendKeyPairWithPassword

func AppendKeyPairWithPassword(tlsConfig *tls.Config, certFile string, keyFile string, pemPass []byte) error

Read in a keypair where the key is password protected

func GetPEMPassword

func GetPEMPassword(pemFile string) []byte

Print a password prompt on the terminal and collect a password

func HasString

func HasString(elem string, arr []string) bool

Determine if a string element is in a string array

func IsEncryptedPEM

func IsEncryptedPEM(pemFile string) bool

Determine if PEM file is encrypted

func ListenAndServeTLS

func ListenAndServeTLS(addr string, handler nethttp.Handler, tlsConfig *tls.Config) error

ListenAndServeTLS acts identically to http.ListenAndServeTLS, except that it expects TLS configuration. TODO: refactor so this is testable?

func NewTLSConfig

func NewTLSConfig(caFile string, verifyCert bool) (*tls.Config, error)

NewTLSConfig returns an initialized TLS configuration suitable for client authentication. If caFile is non-empty, it will be loaded.

func ReadPEMData

func ReadPEMData(pemFile string, pemPass []byte) ([]byte, error)

Read a PEM file and ask for a password to decrypt it if needed

func Verify

func Verify(r *nethttp.Request, validOUs []string) error

Verify that the OU of the presented client certificate matches the list of Valid OUs

func VerifyOUs

func VerifyOUs(validOUs []string) martini.Handler

TODO: make this testable?

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL