1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-27 10:39:53 +03:00

Merge PR #928: OpenVPN X.509 certificate authentication will be used only when no username / password is specified

This commit is contained in:
Davide Beatrici 2019-06-29 16:42:06 +02:00 committed by GitHub
commit 9fbfa61b34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -871,9 +871,13 @@ void OvsBeginIPCAsyncConnectionIfEmpty(OPENVPN_SERVER *s, OPENVPN_SESSION *se, O
p.BridgeMode = true;
}
if (c->ClientCert.X != NULL)
if (IsEmptyStr(c->ClientKey.Username) || IsEmptyStr(c->ClientKey.Password))
{
p.ClientCertificate = c->ClientCert.X;
// OpenVPN X.509 certificate authentication will be used only when no username / password is specified
if (c->ClientCert.X != NULL)
{
p.ClientCertificate = c->ClientCert.X;
}
}
// Calculate the MSS