ssl

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2016 License: MIT Imports: 12 Imported by: 0

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 added in v1.4.590

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

Read in a keypair where the key is password protected

func GetPEMPassword added in v1.4.590

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 added in v1.4.590

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, mutualTLS 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 added in v1.4.590

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