ttls

package module
v0.0.0-...-1fcc2b8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2017 License: MIT Imports: 9 Imported by: 1

README

ttls Go Report Card

small lib thats creating temporary TLS listener with random server certificate.

why temporary ? every time that NewTTLSListener get called , new TLS certificates will be created.

WARNING - Do Not Use For any project that requires MITM protection, more useful for some temporary use cases with local AUTH..

Installation

$ go get -u github.com/yaronsumel/ttls 

Usage

create the TLS Listener with Min effort

	server, _ := ttls.NewTTLSListener("0.0.0.0:8080", nil)

or customize the x509 certificate as you wish

	server, _ := ttls.NewTTLSListener("0.0.0.0:8080", &ttls.X509Opts{
		Country:"US",
		Organization:"GITHUB",
		SerialNumber:12345,
		SubjectKeyID:"somekeyid",
	})

all together


server, _ := ttls.NewTTLSListener("0.0.0.0:8080", nil)

	for {
		conn, err := server.Listener.Accept()
		if err != nil {
		// something went wrong...
		}
		defer conn.Close()
		// do something with the client conn
	}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TTLS

type TTLS struct {
	Listener net.Listener
	// contains filtered or unexported fields
}

TTLS struct

func NewTTLSListener

func NewTTLSListener(laddr string, x509Opts *X509Opts) (*TTLS, error)

NewTTLSListener creates the resources needed to create tls server

type X509Opts

type X509Opts struct {
	SubjectKeyID string
	SerialNumber int64
	Country      string
	Organization string
}

X509Opts .. for custom values

Jump to

Keyboard shortcuts

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