Back to

package tls

v2.24.2-0.20190926123001-d0e311e28391+incompatible (d0e311e)
Latest Go to latest
Published: Sep 26, 2019 | License: GPL3 | Module:


Package tls contains code for TLS certificate generation and signing.



var (
	DefaultLegitConfig = CertConfig{
		Bits:               4096,
		Country:            "US",
		Locality:           "",
		Organization:       "bettercap devteam",
		OrganizationalUnit: "",
		CommonName:         "bettercap",
	DefaultSpoofConfig = CertConfig{
		Bits:               4096,
		Country:            "US",
		Locality:           "Scottsdale",
		Organization:       ", Inc.",
		OrganizationalUnit: "",
		CommonName:         "Go Daddy Secure Certificate Authority - G2",

func CertConfigToModule

func CertConfigToModule(prefix string, m *session.SessionModule, defaults CertConfig)

func CreateCertificate

func CreateCertificate(cfg CertConfig, ca bool) (error, *rsa.PrivateKey, []byte)

func Generate

func Generate(cfg CertConfig, certPath string, keyPath string, ca bool) error

func SignCertificateForHost

func SignCertificateForHost(ca *tls.Certificate, host string, port int) (cert *tls.Certificate, err error)

type CertConfig

type CertConfig struct {
	Bits               int
	Country            string
	Locality           string
	Organization       string
	OrganizationalUnit string
	CommonName         string

func CertConfigFromModule

func CertConfigFromModule(prefix string, m session.SessionModule) (err error, cfg CertConfig)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier