{hostname}:{port} with TLS") except ssl.SSLError as e: print(f"SSL error: {e}") except socket.error as e: print(f"Socket error: {e}") except Exception as e: print(f"Unexpected error: {e}") # 示例使用 hostname = 'example.com' port = 443 check_tls_connection(hostname, ...
return newError("resolve IP").Base(err) } ip = v.IP } fmt.Println("Using IP: ", ip.String()) fmt.Println("Pinging without SNI") { tcpConn, err := net.DialTCP("tcp", nil, &net.TCPAddr{IP: ip, Port: 443}) if err != nil { return newError("dial tcp").Base(err) } ...