diff --git a/src/Renci.SshNet/Netconf/NetConfSession.cs b/src/Renci.SshNet/Netconf/NetConfSession.cs index aca2f8e04..b6da47799 100644 --- a/src/Renci.SshNet/Netconf/NetConfSession.cs +++ b/src/Renci.SshNet/Netconf/NetConfSession.cs @@ -150,7 +150,13 @@ protected override void OnDataReceived(byte[] data) var nsMgr = new XmlNamespaceManager(ServerCapabilities.NameTable); nsMgr.AddNamespace("nc", "urn:ietf:params:xml:ns:netconf:base:1.0"); - _usingFramingProtocol = ServerCapabilities.SelectSingleNode("/nc:hello/nc:capabilities/nc:capability[text()='urn:ietf:params:netconf:base:1.1']", nsMgr) != null; + const string xpath = "/nc:hello/nc:capabilities/nc:capability[text()='urn:ietf:params:netconf:base:1.1']"; + + // This will currently evaluate to false since we (the client) do not advertise 1.1 capability. + // Despite some code existing for the 1.1 framing protocol, it is thought to be incorrect or + // incomplete. The NETCONF code is practically untested at the time of writing. + _usingFramingProtocol = ServerCapabilities.SelectSingleNode(xpath, nsMgr) != null + && ClientCapabilities.SelectSingleNode(xpath, nsMgr) != null; _ = _serverCapabilitiesConfirmed.Set(); }