tlshandler

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinHandler

func GinHandler(router *gin.Engine, server_cert *CertSetup, httpAddr string) (err ftp_context.LogErr)

func LoadCert

func LoadCert(name string, directory string, cert *CertSetup) (err ftp_context.LogErr)

func TLSClient

func TLSClient(caPEMs ...*bytes.Buffer) (tc *http.Client)

Types

type CertData

type CertData struct {
	ftp_filehandler.FileBasic
	Organization  string         `json:"organisation"`
	Country       string         `json:"country"`
	Province      string         `json:"province"`
	Locality      string         `json:"locality"`
	StreetAddress string         `json:"street_address"`
	PostalCode    string         `json:"postal_code"`
	NotAfter      NotAfterStruct `json:"add_date"`
	IPAddrresses  []net.IP       `json:"ip_addresses"`
}

type CertSetup

type CertSetup struct {
	ftp_filehandler.FileBasic

	CertData   *CertData       `json:"cert_data"`
	PrivKey    *rsa.PrivateKey `json:"private_key"`
	PEM        *bytes.Buffer   `json:"pem"`
	PrivKeyPEM *bytes.Buffer   `json:"private_key_pem"`
	TlsCert    tls.Certificate `json:"tls_cert"`
	// contains filtered or unexported fields
}

func NewCA

func NewCA(org *CertData) (cs *CertSetup)

set up our CA certificate

func (CertSetup) Error

func (cs CertSetup) Error() string

func (CertSetup) HasErr

func (cs CertSetup) HasErr() bool

func (CertSetup) NewServerCert

func (c_a CertSetup) NewServerCert(org *CertData) (cs *CertSetup)

func (CertSetup) ServerTlsConfig

func (cs CertSetup) ServerTlsConfig() (tlc *tls.Config, err error)

func (CertSetup) UnderlyingError

func (cs CertSetup) UnderlyingError() error

type NotAfterStruct

type NotAfterStruct struct {
	Years  int `json:"years"`
	Months int `json:"months"`
	Days   int `json:"days"`
}

Jump to

Keyboard shortcuts

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