func isX509Error(err error) bool {
	switch errType := errors.Cause(err).(type) {
	case *websocket.CloseError:
		return errType.Code == websocket.CloseTLSHandshake
	case x509.CertificateInvalidError,
		x509.HostnameError,
		x509.InsecureAlgorithmError,
		x509.UnhandledCriticalExtension,
		x509.UnknownAuthorityError,
		x509.ConstraintViolationError,
		x509.SystemRootsError:
		return true
	default:
		return false
	}
}
// isX509Error reports whether the given websocket error
// results from an X509 problem.
isX509Error reports whether the given websocket error
results from an X509 problem.
// isX509Error reports whether the given websocket error // results from an X509 problem .
func isX509Error(err error) bool {
	switch errType := errors.Cause(err).(type) {
	case *websocket.CloseError:
		return errType.Code == websocket.CloseTLSHandshake
	case x509.CertificateInvalidError,
		x509.HostnameError,
		x509.InsecureAlgorithmError,
		x509.UnhandledCriticalExtension,
		x509.UnknownAuthorityError,
		x509.ConstraintViolationError,
		x509.SystemRootsError:
		return true
	default:
		return false
	}
}
func isX509Error ( err error ) bool { switch errType := errors . Cause ( err ) . ( type ) { case * websocket . CloseError : return errType . Code == websocket . CloseTLSHandshake case x509 . CertificateInvalidError , x509 . HostnameError , x509 . InsecureAlgorithmError , x509 . UnhandledCriticalExtension , x509 . UnknownAuthorityError , x509 . ConstraintViolationError , x509 . SystemRootsError : return true default : return false } }
isX509Error reports whether the given websocket error
results from an X509 problem.
isX509Error reports whether the given websocket error results from an X509 problem .