tlsgo

package
v0.0.0-...-d67406e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package tlsgo provides a mgo connection using Go's native TLS library.

Package tlsgo implements connection to MongoDB with Go native TLS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TLSConfig

type TLSConfig struct {
	// contains filtered or unexported fields
}

TLSConfig contains options for configuring an SSL connection to the server.

func NewTLSConfig

func NewTLSConfig() *TLSConfig

NewTLSConfig creates a new TLSConfig.

func (*TLSConfig) AddCaCertFromFile

func (c *TLSConfig) AddCaCertFromFile(caFile string) error

AddCaCertFromFile adds a root CA certificate to the configuration given a path to the containing file.

func (*TLSConfig) AddClientCertFromFile

func (c *TLSConfig) AddClientCertFromFile(clientFile, password string) (string, error)

AddClientCertFromFile adds a client certificate to the configuration given a path to the containing file and returns the certificate's subject name.

func (*TLSConfig) MakeConfig

func (c *TLSConfig) MakeConfig() (*tls.Config, error)

MakeConfig constructs a new tls.Config from the configuration specified.

func (*TLSConfig) SetInsecure

func (c *TLSConfig) SetInsecure(allow bool)

SetInsecure sets whether the client should verify the server's certificate chain and hostnames.

type TLSDBConnector

type TLSDBConnector struct {
	// contains filtered or unexported fields
}

TLSDBConnector makes a connection to the database with Go native TLS.

func (*TLSDBConnector) Configure

func (c *TLSDBConnector) Configure(opts options.ToolOptions) error

Configure the connector to connect to the server over ssl. Sets up the correct function to dial the server based on the ssl options passed in.

func (*TLSDBConnector) GetNewSession

func (c *TLSDBConnector) GetNewSession() (*mgo.Session, error)

GetNewSession dials the server.

Jump to

Keyboard shortcuts

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