mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-18 04:43:12 +02:00
* Fix typo when passing arguments to tls.LoadX509KeyPair() * Support TLS 1.2 too * Do not require a controller to only present a single certificate * No need to set ServerName since we use InsecureSkipVerify * Use host's root CA set by default and support normal SNI scenarios
27 lines
558 B
Go
27 lines
558 B
Go
package client
|
|
|
|
import (
|
|
"crypto/x509"
|
|
)
|
|
|
|
type Option func(*Client)
|
|
|
|
func WithAddress(address string) Option {
|
|
return func(client *Client) {
|
|
client.address = address
|
|
}
|
|
}
|
|
|
|
func WithTrustedCertificate(trustedCertificate *x509.Certificate) Option {
|
|
return func(client *Client) {
|
|
client.trustedCertificate = trustedCertificate
|
|
}
|
|
}
|
|
|
|
func WithCredentials(serviceAccountName string, serviceAccountToken string) Option {
|
|
return func(client *Client) {
|
|
client.serviceAccountName = serviceAccountName
|
|
client.serviceAccountToken = serviceAccountToken
|
|
}
|
|
}
|