Filesystem-like manager to provide TLS/SSL certificate creation, renewal and retrieval.
go get -u github.com/wirekit/tlsfs
Below are examples of creating a tlsfs Filesystem based on using Let's Encrypt as the desired CA authority.
import (
"os"
"github.com/wirekit/tlsfs/fs/memfs"
"github.com/wirekit/tlsfs/tlsp/acme"
)
var config acme.Config
config.HTTPChallengePort = 3550
config.TLSSNIChallengePort = 4433
config.EnableHTTP01Challenge = true
config.UsersFileSystem = memfs.NewMemFS()
config.CertificatesFileSystem = memfs.NewMemFS()
config.CAURL = "https://acme-v01.api.letsencrypt.org/directory"
service := acme.NewAcmeFS(config)
service.Create("bob@gmail.com", "*.westros.com")
import (
"os"
"github.com/wirekit/tlsfs/fs/sysfs"
"github.com/wirekit/tlsfs/tlsp/acme"
)
var config acme.Config
config.HTTPChallengePort = 3550
config.TLSSNIChallengePort = 4433
config.EnableHTTP01Challenge = true
config.UsersFileSystem = sysfs.NewSystemZapFS("acme/users")
config.CertificatesFileSystem = sysfs.NewSystemZapFS("acme/certs")
config.CAURL = "https://acme-v01.api.letsencrypt.org/directory"
service := acme.NewAcmeFS(config)
service.Create("bob@gmail.com", "*.westros.com")
Vendoring was done with Dep.