utils

package
v0.0.0-...-a9fda57 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2015 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureClientTLS

func ConfigureClientTLS(opts *ClientTLSOpts) (*tls.Config, error)

ConfigureClientTLS generates a tls configuration for clients using the provided parameters. / Note that if the root CA file contains invalid data, behavior is not guaranteed. Currently (as of Go 1.5.1) only the valid certificates up to the bad data will be parsed and added the root CA pool.

func ConfigureServerTLS

func ConfigureServerTLS(opts *ServerTLSOpts) (*tls.Config, error)

ConfigureServerTLS specifies a set of ciphersuites, the server cert and key, and optionally client authentication. Note that a tls configuration is constructed that either requires and verifies client authentication or doesn't deal with client certs at all. Nothing in the middle.

Also note that if the client CA file contains invalid data, behavior is not guaranteed. Currently (as of Go 1.5.1) only the valid certificates up to the bad data will be parsed and added the client CA pool.

func NotFoundHandler

func NotFoundHandler(ctx context.Context, w http.ResponseWriter, r *http.Request) error

NotFoundHandler is used as a generic catch all handler to return the ErrMetadataNotFound 404 response

func RootHandlerFactory

func RootHandlerFactory(auth auth.AccessController, ctx context.Context, trust signed.CryptoService) func(contextHandler, ...string) *rootHandler

RootHandlerFactory creates a new rootHandler factory using the given Context creator and authorizer. The returned factory allows creating new rootHandlers from the alternate http handler contextHandler and a scope.

Types

type ClientTLSOpts

type ClientTLSOpts struct {
	RootCAFile         string
	ServerName         string
	InsecureSkipVerify bool
	ClientCertFile     string
	ClientKeyFile      string
}

ClientTLSOpts is a struct that contains options to pass to ConfigureClientTLS

type ServerTLSOpts

type ServerTLSOpts struct {
	ServerCertFile    string
	ServerKeyFile     string
	RequireClientAuth bool
	ClientCAFile      string
}

ServerTLSOpts generates a tls configuration for servers using the provided parameters.

Jump to

Keyboard shortcuts

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