go-tls-auth

command module
v0.0.0-...-ce027a9 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 9 Imported by: 0

README

TLS Client Authentication in Go

Demonstrates certificate-based TLS client authentication in Go.

Requires a PEM file containing an X.509 certificate and corresponding private key in PKCS#8 format, which can optionally be encrypted.

To create the PEM file with a self-signed cert and encrypted private key:

openssl req -x509 -newkey rsa:4096 -keyout /dev/stdout -out /dev/stdout -sha256 -days 365 -subj "/CN=gopher" > cert.pem

To leave the private key unencrypted (not recommended!), add -nodes to the openssl command line.

Because of this issue we can't use the Go standard library for the decryption, so we use pemutil instead.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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