open-vault/sdk/helper/tlsutil/tlsutil.go

36 lines
1003 B
Go
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// DEPRECATED: this has been moved to go-secure-stdlib and will be removed
2016-07-13 15:29:17 +00:00
package tlsutil
import (
"crypto/tls"
exttlsutil "github.com/hashicorp/go-secure-stdlib/tlsutil"
)
2016-07-13 15:29:17 +00:00
var ErrInvalidCertParams = exttlsutil.ErrInvalidCertParams
var TLSLookup = exttlsutil.TLSLookup
func ParseCiphers(cipherStr string) ([]uint16, error) {
return exttlsutil.ParseCiphers(cipherStr)
}
func GetCipherName(cipher uint16) (string, error) {
return exttlsutil.GetCipherName(cipher)
}
func ClientTLSConfig(caCert []byte, clientCert []byte, clientKey []byte) (*tls.Config, error) {
return exttlsutil.ClientTLSConfig(caCert, clientCert, clientKey)
}
func LoadClientTLSConfig(caCert, clientCert, clientKey string) (*tls.Config, error) {
return exttlsutil.LoadClientTLSConfig(caCert, clientCert, clientKey)
}
func SetupTLSConfig(conf map[string]string, address string) (*tls.Config, error) {
return exttlsutil.SetupTLSConfig(conf, address)
}