frostfs-node/pkg/network/tls.go
Pavel Karpy 28aa0f521e [] pkg/network: Delete tls multiaddr implementation
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-08-02 14:28:58 +03:00

23 lines
459 B
Go

package network
import (
"github.com/multiformats/go-multiaddr"
)
const (
tlsProtocolName = "tls"
)
// tls var is used for (un)wrapping other multiaddrs around TLS multiaddr.
var tls, _ = multiaddr.NewMultiaddr("/" + tlsProtocolName)
// TLSEnabled searches for wrapped TLS protocol in multiaddr.
func (a Address) TLSEnabled() bool {
for _, protoc := range a.ma.Protocols() {
if protoc.Code == multiaddr.P_TLS {
return true
}
}
return false
}