Backport PR #3978: fix `--existing` with non-localhost IP

there's still some cleanup to do with duplicate code in ConsoleApp that should be invoked from ConnectionFileMixin, but this fixes the bug.

closes #3977