Fix issue providing pem file at unexpanded path

This fixes the case where a key file path is provided which does not have the .pem extension and an unexpanded path.

e.g.

`~/.ssh/id_rsa`