SFTP KIO slave uses wrong SSH keys

This has previously been reported at https://bugs.kde.org/show_bug.cgi?id=448768, but according to them it's an upstream issue. When trying to connect to a server with the kio slave it does not pick keys correctly. If you have multiple host section in the ssh config mapped to the same HostName, it will try the keys from all of them, possibly being rejected due to too many attempts. And if you have a host with multiple keys, it might only try the first one. Oddly, it keeps trying the same keys even if you remove them from the ssh config, so it must be caching them somewhere and not reloading the config properly. This only happens with the sftp kio slave, not with the fish kio slave or the sftp command line utility.

I think it has something to do with SSH agent auth, it works properly if I unset SSH_AUTH_SOCK.

Operating System: openSUSE Tumbleweed 20220703
KDE Plasma Version: 5.25.2
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5
Kernel Version: 5.18.6-1-default (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 62.7 Gibyte of RAM
Graphics Processor: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2
Manufacturer: ASUS
Edited by LinAGKar