frostfs-node/pkg/morph/client/mtls.go
Evgenii Stratonikov 42ecc2f2b9 [#1170] morph: Support mTLS
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-06-14 09:26:27 +03:00

22 lines
403 B
Go

package client
import (
"crypto/tls"
"github.com/nspcc-dev/neo-go/pkg/rpcclient"
)
// MTLSConfig represents endpoint mTLS configuration.
type MTLSConfig struct {
TrustedCAList []string
KeyFile string
CertFile string
}
func (m *MTLSConfig) parse() (*tls.Config, error) {
if m == nil {
return nil, nil
}
return rpcclient.TLSClientConfig(m.TrustedCAList, m.CertFile, m.KeyFile)
}