How about we prompt for password irrespective of what is the error from sshtunnel library?
Try to connect without a password for identity file based, if any error comes then ask for password along with displaying the error message. No need to bother what the error is about.
I am working on the feature "Option to Skip Password Dialog for Identity File" #6996.
I initially tried implementing it so that the tunnel password would not be requested upfront, and would only be prompted on error. However, the sshtunnel library currently returns a generic error message, for which I have created an issue on the SSHTunnel GitHub repository #305.
This approach introduces multiple scenarios for when to prompt for the tunnel password, making the code more complex and harder to maintain.
Proposed solution: Add a new switch "Prompt for password?" in the server dialog under the SSHTunnel tab. By default, the switch is set to false and is enabled only when the authentication method is Identity File. See the screenshot below for reference.
Thoughts/suggestions?
Akshay Joshi
Principal Engineer | Engineering Manager | pgAdmin Hacker