github.com/hashicorp/vault/sdk@v0.11.0/helper/tlsutil/tlsutil.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  // DEPRECATED: this has been moved to go-secure-stdlib and will be removed
     5  package tlsutil
     6  
     7  import (
     8  	"crypto/tls"
     9  
    10  	exttlsutil "github.com/hashicorp/go-secure-stdlib/tlsutil"
    11  )
    12  
    13  var ErrInvalidCertParams = exttlsutil.ErrInvalidCertParams
    14  
    15  var TLSLookup = exttlsutil.TLSLookup
    16  
    17  func ParseCiphers(cipherStr string) ([]uint16, error) {
    18  	return exttlsutil.ParseCiphers(cipherStr)
    19  }
    20  
    21  func GetCipherName(cipher uint16) (string, error) {
    22  	return exttlsutil.GetCipherName(cipher)
    23  }
    24  
    25  func ClientTLSConfig(caCert []byte, clientCert []byte, clientKey []byte) (*tls.Config, error) {
    26  	return exttlsutil.ClientTLSConfig(caCert, clientCert, clientKey)
    27  }
    28  
    29  func LoadClientTLSConfig(caCert, clientCert, clientKey string) (*tls.Config, error) {
    30  	return exttlsutil.LoadClientTLSConfig(caCert, clientCert, clientKey)
    31  }
    32  
    33  func SetupTLSConfig(conf map[string]string, address string) (*tls.Config, error) {
    34  	return exttlsutil.SetupTLSConfig(conf, address)
    35  }