2021-07-15 05:56:37 +00:00
|
|
|
// DEPRECATED: this has been moved to go-secure-stdlib and will be removed
|
2016-07-13 15:29:17 +00:00
|
|
|
package tlsutil
|
|
|
|
|
2017-01-23 18:48:35 +00:00
|
|
|
import (
|
|
|
|
"crypto/tls"
|
|
|
|
|
2021-07-15 05:56:37 +00:00
|
|
|
exttlsutil "github.com/hashicorp/go-secure-stdlib/tlsutil"
|
2017-01-23 18:48:35 +00:00
|
|
|
)
|
2016-07-13 15:29:17 +00:00
|
|
|
|
2021-07-15 05:56:37 +00:00
|
|
|
var ErrInvalidCertParams = exttlsutil.ErrInvalidCertParams
|
2019-06-23 01:51:52 +00:00
|
|
|
|
2021-07-15 05:56:37 +00:00
|
|
|
var TLSLookup = exttlsutil.TLSLookup
|
2019-03-01 15:48:06 +00:00
|
|
|
|
2017-01-23 18:48:35 +00:00
|
|
|
func ParseCiphers(cipherStr string) ([]uint16, error) {
|
2021-07-15 05:56:37 +00:00
|
|
|
return exttlsutil.ParseCiphers(cipherStr)
|
2017-01-23 18:48:35 +00:00
|
|
|
}
|
2019-03-01 15:48:06 +00:00
|
|
|
|
|
|
|
func GetCipherName(cipher uint16) (string, error) {
|
2021-07-15 05:56:37 +00:00
|
|
|
return exttlsutil.GetCipherName(cipher)
|
2019-03-01 15:48:06 +00:00
|
|
|
}
|
2019-06-23 01:51:52 +00:00
|
|
|
|
|
|
|
func ClientTLSConfig(caCert []byte, clientCert []byte, clientKey []byte) (*tls.Config, error) {
|
2021-07-15 05:56:37 +00:00
|
|
|
return exttlsutil.ClientTLSConfig(caCert, clientCert, clientKey)
|
2019-06-23 01:51:52 +00:00
|
|
|
}
|
2020-01-24 17:42:03 +00:00
|
|
|
|
2020-05-07 01:26:08 +00:00
|
|
|
func LoadClientTLSConfig(caCert, clientCert, clientKey string) (*tls.Config, error) {
|
2021-07-15 05:56:37 +00:00
|
|
|
return exttlsutil.LoadClientTLSConfig(caCert, clientCert, clientKey)
|
2020-05-07 01:26:08 +00:00
|
|
|
}
|
|
|
|
|
2020-01-24 17:42:03 +00:00
|
|
|
func SetupTLSConfig(conf map[string]string, address string) (*tls.Config, error) {
|
2021-07-15 05:56:37 +00:00
|
|
|
return exttlsutil.SetupTLSConfig(conf, address)
|
2020-01-24 17:42:03 +00:00
|
|
|
}
|