fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/core/config/endpoint Index | Files

package endpoint

import "github.com/hyperledger/fabric-sdk-go/pkg/core/config/endpoint"

Index

Package Files

endpoint.go

func AttemptSecured Uses

func AttemptSecured(url string, allowInSecure bool) bool

AttemptSecured is a utility function which verifies URL and returns if secured connections needs to established for protocol 'grpcs' in URL returns true for protocol 'grpc' in URL returns false for no protocol mentioned, returns !allowInSecure

func IsTLSEnabled Uses

func IsTLSEnabled(url string) bool

IsTLSEnabled is a generic function that expects a URL and verifies if it has a prefix HTTPS or GRPCS to return true for TLS Enabled URLs or false otherwise

func ToAddress Uses

func ToAddress(url string) string

ToAddress is a utility function to trim the GRPC protocol prefix as it is not needed by GO if the GRPC protocol is not found, the url is returned unchanged

type MutualTLSConfig Uses

type MutualTLSConfig struct {
    Pem []string
    // Certfiles root certificates for TLS validation (Comma separated path list)
    Path string

    //Client TLS information
    Client TLSKeyPair
}

MutualTLSConfig Mutual TLS configurations

type TLSConfig Uses

type TLSConfig struct {
    // the following two fields are interchangeable.
    // If Path is available, then it will be used to load the cert
    // if Pem is available, then it has the raw data of the cert it will be used as-is
    // Certificate root certificate path
    // If both Path and Pem are available, pem takes the precedence
    Path string
    // Certificate actual content
    Pem string
    // contains filtered or unexported fields
}

TLSConfig TLS configuration used in the sdk's configs.

func (*TLSConfig) Bytes Uses

func (cfg *TLSConfig) Bytes() []byte

Bytes returns the tls certificate as a byte array

func (*TLSConfig) LoadBytes Uses

func (cfg *TLSConfig) LoadBytes() error

LoadBytes preloads bytes from Pem/Path Pem takes precedence over Path

func (*TLSConfig) TLSCert Uses

func (cfg *TLSConfig) TLSCert() (*x509.Certificate, bool, error)

TLSCert returns the tls certificate as a *x509.Certificate by loading it either from the embedded Pem or Path

type TLSKeyPair Uses

type TLSKeyPair struct {
    Key  TLSConfig
    Cert TLSConfig
}

TLSKeyPair contains the private key and certificate for TLS encryption

Package endpoint imports 6 packages (graph) and is imported by 8 packages. Updated 2019-04-18. Refresh now. Tools for package owners.