//NewSSLClient ... func NewSSLClient(host string) *SSLClient { conn, err := tls.Dial("tcp", host, p.NewSSLConfig()) if err != nil { logger.Errorf("Error:--->cannnot create client %s\n", err) return nil } return &SSLClient{*conn} }
func newServer(vpsConfig *c.RemoteConfig) *pserver { host := vpsConfig.Host + ":" + strconv.Itoa(vpsConfig.Port) ts, err := tls.Listen("tcp", host, c.NewSSLConfig()) if err != nil { logger.Errorf("create server failed %s", err) return nil } return &pserver{ts} }