utils

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2017 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCertToDefaultPool added in v0.0.7

func AddCertToDefaultPool(fpath string) error

AddCertToDefaultPool adds certificate from file to default pool

func CertFromFilePair

func CertFromFilePair(certFile, keyFile string) (*tls.Certificate, error)

CertFromFilePair returns an tls.Certificate containing the certificates public/private key pair from a pair of given PEM-encoded files. Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates

func CertPoolFromFile

func CertPoolFromFile(filename string) (*x509.CertPool, error)

CertPoolFromFile returns an x509.CertPool containing the certificates in the given PEM-encoded file. Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates

func NewServerTLS

func NewServerTLS(certFile, keyFile, caFile string) (*tls.Config, error)

NewServerTLS constructs a TLS from the input certificate file, key file for server and certificate file for client verification.

func SourceFileAndLine

func SourceFileAndLine() string

SourceFileAndLine return source file and line where it was called

Types

This section is empty.

Jump to

Keyboard shortcuts

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