Juniper / go-netconf

NETCONF implementation in Go.
Other
253 stars 110 forks source link

Allow pass through of address to ssh.NewClientConn() #77

Closed darylturner closed 2 years ago

darylturner commented 6 years ago

I was having an issue creating a netconf session via an SSH jump host when using a known_hosts HostsKeyCallback. The Go SSH client intentionally sets net.Conn.RemoteAddr to zero when dialing a session from an existing SSH client. I believe this is why the address is an argument to the ssh.NewClientConn function.

netconf.NewSSHSession as currently implemented derives the address used for the handshake directly from the connection and does not allow it to be set manually.

Added a fix and an example but this would be a breaking change to any programs calling netconf.NewSSHSession(). Not sure if this is an issue with current "pre-alpha" status or if this would need to be put on hold for a major release change.

Any suggested workarounds welcome ofcourse. Took a look at setting up the transport myself but currently requires access to private attributes and methods.

darylturner commented 2 years ago

Agreed about breaking change. Will keep an eye out for v2. Thanks