Skip to content
more convenient package to create tls.Config
Go
Branch: master
Clone or download
Latest commit c7ee473 Aug 26, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md add README Aug 26, 2019
go.mod
tlsconfig.go first commit Aug 26, 2019

README.md

tlsconfig

Create tls.Config with Options.

中文说明

Mutual TLS Authentication

** Server **

import "github.com/x-mod/tlsconfig"

cf := tlsconfig.New(
    //服务端 TLS 证书
    tlsconfig.CertKeyPair("out/server.crt", "out/server.key"), 
    //客户端 TLS 证书签名 CA
    tlsconfig.ClientCA("out/exampleCA.crt"), 
    //验证客户端证书
    tlsconfig.ClientAuthVerified(),
)

** Client **

import "github.com/x-mod/tlsconfig"

cf := tlsconfig.New(
    //服务端 TLS 证书签名 CA
    tlsconfig.CA("out/exampleCA.crt"), 
    //客户端证书 TLS 证书
    tlsconfig.CertKeyPair("out/client.crt", "out/client.key"), 
)
You can’t perform that action at this time.