This commit is contained in:
crusader 2018-07-04 12:14:25 +09:00
parent 8f73e25dd7
commit 20fddbf86e

View File

@ -3,7 +3,6 @@ package health
import (
"crypto/tls"
"encoding/base64"
"fmt"
"net"
cnsm "git.loafle.net/commons/service_matcher-go"
@ -30,7 +29,7 @@ func (s *SocketHealthCrawler) getConnection(config *ocmsc.SensorConfig) (net.Con
metaPortTypeKey := connection.MetaPortTypeKey
metaCryptoTypeKey := connection.MetaCryptoTypeKey
addr := fmt.Sprintf("%s:%s", ip, port)
addr := net.JoinHostPort(ip, port.String())
network := ""
switch metaIPTypeKey {
@ -55,7 +54,8 @@ func (s *SocketHealthCrawler) getConnection(config *ocmsc.SensorConfig) (net.Con
return nil, err
}
if metaCryptoTypeKey == ocmm.MetaCryptoTypeEnumTLS.String() {
switch metaCryptoTypeKey {
case ocmm.MetaCryptoTypeEnumTLS.String():
cfg := &tls.Config{
InsecureSkipVerify: true,
ServerName: ip,
@ -67,6 +67,7 @@ func (s *SocketHealthCrawler) getConnection(config *ocmsc.SensorConfig) (net.Con
}
conn = tlsConn
default:
}
return conn, nil