https://github.com/x-mod/tlsconfig
more convenient package to create tls.Config
https://github.com/x-mod/tlsconfig
mtls tls-certificate
Last synced: 5 months ago
JSON representation
more convenient package to create tls.Config
- Host: GitHub
- URL: https://github.com/x-mod/tlsconfig
- Owner: x-mod
- Created: 2019-08-26T04:05:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-03-17T14:33:25.000Z (about 6 years ago)
- Last Synced: 2024-06-19T16:48:14.197Z (almost 2 years ago)
- Topics: mtls, tls-certificate
- Language: Go
- Homepage:
- Size: 1000 Bytes
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
tlsconfig
===
Create tls.Config with Options.
[中文说明](https://gitdig.com/)
# Mutual TLS Authentication
** Server **
````go
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 **
````go
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"),
)
````