secureconnection

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const StartTls = "starttls"

Variables

View Source
var (
	ErrNoHostname              = errors.New("no hostname provided")
	ErrNoPort                  = errors.New("no tcp-port provided")
	ErrFileDoesNotExist        = errors.New("file does not exist")
	ErrFile                    = errors.New("error file")
	ErrFailedAppendCertificate = errors.New("failed to append PEM certificate")
	ErrStarttlsNotSupported    = errors.New("server does not support STARTTLS")
	ErrSslTlsNotSupported      = errors.New("server does not support SSL/TLS")
	ErrUnknownProtocol         = errors.New("unkown security protocol")
)

Functions

This section is empty.

Types

type ConnectNone

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

func NewConnectNone

func NewConnectNone(hostname string, port int) *ConnectNone

func (*ConnectNone) Check

func (c *ConnectNone) Check() error

func (*ConnectNone) ClientConnect

func (c *ConnectNone) ClientConnect() (*smtp.Client, func() error, string, error)

func (*ConnectNone) GetHostName

func (c *ConnectNone) GetHostName() string

func (*ConnectNone) GetType

func (c *ConnectNone) GetType() types.Security

type ConnectSslTls

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

func NewConnectSslTls

func NewConnectSslTls(hostname string, port int, rootCaPath string) *ConnectSslTls

func (*ConnectSslTls) Check

func (c *ConnectSslTls) Check() error

func (*ConnectSslTls) ClientConnect

func (c *ConnectSslTls) ClientConnect() (*smtp.Client, func() error, string, error)

func (*ConnectSslTls) GetHostName

func (c *ConnectSslTls) GetHostName() string

func (*ConnectSslTls) GetType

func (c *ConnectSslTls) GetType() types.Security

type ConnectStarttls

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

func NewConnectStarttls

func NewConnectStarttls(hostname string, port int, rootCaPath string) *ConnectStarttls

func (*ConnectStarttls) Check

func (c *ConnectStarttls) Check() error

func (*ConnectStarttls) ClientConnect

func (c *ConnectStarttls) ClientConnect() (*smtp.Client, func() error, string, error)

func (*ConnectStarttls) GetHostName

func (c *ConnectStarttls) GetHostName() string

func (*ConnectStarttls) GetType

func (c *ConnectStarttls) GetType() types.Security

type SecureConnection

type SecureConnection interface {
	Check() error
	ClientConnect() (*smtp.Client, func() error, string, error)
	GetType() types.Security
	GetHostName() string
}

func GetSecureConnection

func GetSecureConnection(st *cmdflags.Settings) (SecureConnection, error)

Jump to

Keyboard shortcuts

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