I have a simple program using netconf client version ncclient 0.6.13 with Python3 running on PPC64LE Red hat Version Red Hat Enterprise Linux release 9.2 (Plow) which is using netconf yang to connect to the remote Cisco router.
import os
from ncclient import manager
filter = """
<filter xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
<hostname></hostname>
</native>
</filter>
"""
with manager.connect(host="192.168.20.55", port=830, username="admin", password="password", hostkey_verify=False, allow_agent=False, look_for_keys=False, device_params={'name':'csr'}) as m:
response = m.get_config("running", filter)
# Print the XML response
print(response.xml)
and I am getting this error:
Traceback (most recent call last):
File "/usr/lib/powerns-vpn/alpha.py", line 26, in <module>
with manager.connect(host="192.168.20.55", port=830, username="admin", password="password!", hostkey_verify=False, allow_agent=False, look_for_keys=False, device_params={'name':'csr'}) as m:
File "/usr/local/lib/python3.9/site-packages/ncclient/manager.py", line 176, in connect
return connect_ssh(*args, **kwds)
File "/usr/local/lib/python3.9/site-packages/ncclient/manager.py", line 143, in connect_ssh
session.connect(*args, **kwds)
File "/usr/local/lib/python3.9/site-packages/ncclient/transport/ssh.py", line 331, in connect
self._transport.start_client()
File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 660, in start_client
raise e
File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2075, in run
self.kex_engine.parse_next(ptype, m)
File "/usr/local/lib/python3.9/site-packages/paramiko/kex_ecdh_nist.py", line 53, in parse_next
return self._parse_kexecdh_reply(m)
File "/usr/local/lib/python3.9/site-packages/paramiko/kex_ecdh_nist.py", line 136, in _parse_kexecdh_reply
self.transport._verify_key(K_S, sig)
File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 1886, in _verify_key
if not key.verify_ssh_sig(self.H, Message(sig)):
File "/usr/local/lib/python3.9/site-packages/paramiko/rsakey.py", line 133, in verify_ssh_sig
key.verify(
File "/usr/local/lib64/python3.9/site-packages/cryptography/hazmat/backends/openssl/rsa.py", line 582, in verify
_rsa_sig_verify(
File "/usr/local/lib64/python3.9/site-packages/cryptography/hazmat/backends/openssl/rsa.py", line 308, in _rsa_sig_verify
pkey_ctx = _rsa_sig_setup(
File "/usr/local/lib64/python3.9/site-packages/cryptography/hazmat/backends/openssl/rsa.py", line 236, in _rsa_sig_setup
raise UnsupportedAlgorithm(
cryptography.exceptions.UnsupportedAlgorithm: sha1 is not supported by this backend for RSA signing.
I was expecting it will connect without issues.