Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Renci.SshNet/Netconf/NetConfSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down