"""What the driver hands netmiko for the SSH connection.""" from __future__ import annotations from typing import Any from napalm.base.netmiko_helpers import netmiko_args #: The switch offers DH group14 and group16 only, and paramiko picks group16. Its #: 4096-bit exchange takes 9-16 s on an SG2210P with firmware 5.30, against #: netmiko's 10 s conn_timeout; group14 takes 1.5 s. SLOW_KEX: dict[str, list[str]] = {"kex": ["diffie-hellman-group16-sha512"]} def netmiko_connect_args(optional_args: dict[str, Any]) -> dict[str, Any]: """netmiko's share of ``optional_args``, without group16 unless the caller says otherwise.""" args: dict[str, Any] = netmiko_args(optional_args) args.setdefault("disabled_algorithms", SLOW_KEX) return args