How to Use the Same OpenVPN Static Key for Multiple Servers (TCP and UDP)?

I have set up two proxy servers on a single physical server (using the free version).

I have set up two servers, one using TCP and the other using UDP. When I download the profile files from the user interface, I get two separate configuration files, but the OpenVPN static keys inside them (the part marked with -----BEGIN OpenVPN Static key V1-----) are different.

Is there a way to make the OpenVPN static keys the same for multiple servers?

This would allow me to use a single profile file for the client (with multiple remote lines written inside). The OpenVPN client could then automatically connect to an available remote. For example, if the first remote (UDP) is blocked due to network restrictions, the client could automatically connect to the second remote (TCP).

However, for this functionality to work, the OpenVPN static keys for multiple servers need to be the same. Could you please help me achieve this?

Copy the tls_auth_key field in the servers collection in the database.

var tlsAuthKey = db.servers.findOne({}, { tls_auth_key: 1 }).tls_auth_key;
if (tlsAuthKey) {
    db.servers.updateMany({}, { $set: { tls_auth_key: tlsAuthKey } });
}
1 Like

Thank you. :partying_face: