Share SSH Key with Docker-Machine and generic driver


I have an exisiting VM with docker installed (CoreOS) and I can connect to docker with the following powershell command.

docker-machine create --driver generic --generic-ip-address=$IP --generic-ssh-key=$keyPath --generic-ssh-user=user vm
docker-machine env vm | Invoke-Expression # Set Environment Variables

Everything worked fine. I was able to build and run containers.

Then I told my build server to run the powershell script and it was running successfully. But then I lost the connection on my dev machine and got the following exception

Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "$IP": x509: certificate signed by unknown authority
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which might stop running containers.

When I recreate my config with docker-machine rm vm it works again.

I am confused now.