package
Version:
v3.1.0-alpha
Opens a new window with list of versions in this module.
Published: Feb 11, 2020
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
Documentation
¶
Package tlsconfig provides more convenient way to create "tls.Config".
Usage:
package main
import "fmt"
import "go.ligato.io/vpp-agent/v3/cmd/agentctl/client/tlsconfig"
func main() {
tc, err := tlsconfig.New(
tlsconfig.CA("/path/to/ca.crt"),
tlsconfig.CertKey("/path/to/server.crt", "/path/to/server.key"),
)
if err != nil {
fmt.Printf("Error while creating TLS config: %v\n", err)
return
}
fmt.Println("TLS config is ready to use")
// `tc` usage
}
New returns tls.Config with all options applied.
Option applies a modification on a tls.Config.
CA adds CA certificate from file to tls.Config.
If not using this Option, then TLS will be using the host's root CA set.
CertKey adds certificate with key to tls.Config.
func SkipServerVerification() Option
SkipServerVerification turns off verification of server's certificate chain and host name.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.