OpenVPN X.509 certificate authentication will be used only when no username / password is specified

This commit is contained in:
Daiyuu Nobori committed 2019-06-29 21:30:58 +09:00
1 parent 2da6e4c491
commit 7ef7c36c83
1 file changed
+6 -2
+6 -2
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