Ssl – OpenVPN: Where sould the private key be generated

openvpnsslvpn

A friend of mine says that the keys (private and public) for the clients shall be generated at the server and somehow delivered to the client when setting up a new client for an OpenVPN based network.

Wouldn't it be much safer to generate the keys on the client and just send the public key without the private key to the server? Or is there any reason why the server would need the private key of the client, too?

(I'm a noob at all this encryption stuff so I could be totally wrong.)

Best Answer

You're absolutely right.

The whole ethos of PKI is that public key (or certificate) contains everything required for a third party (your VPN server in this instance) to validate it's authenticity. The private key is required only by the client for signing these validation challenges.

Although it can make the process of enrolling new users slightly more long winded. By having each client generate their own private key and certificate signing request, you are restricting the distribution of the private keys and vastly increasing the security.

A better solution yet is to have the private keys generated by users/clients onto two-factor tokens. Nearly all contain onboard RSA engines, that enable them to generate the private key securely and stipulate that it can never leave the token.

Related Topic