1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-25 09:39:52 +03:00

Add the Alternative subject name field on the new X.509 certificate creation.

This commit is contained in:
Daiyuu Nobori 2018-01-15 10:29:30 +09:00 committed by Moataz Elmasry
parent 02bcf9152c
commit 8c0c4396b7

View File

@ -1928,6 +1928,18 @@ X509 *NewX509(K *pub, K *priv, X *ca, NAME *name, UINT days, X_SERIAL *serial)
X509_EXTENSION_free(eku);
}
// Alternative subject name
if (UniIsEmptyStr(name->CommonName) == false)
{
char alt_dns[MAX_PATH];
Format(alt_dns, sizeof(alt_dns), "DNS.1:%S", name->CommonName);
ex = X509V3_EXT_conf_nid(NULL, NULL, NID_subject_alt_name, alt_dns);
X509_add_ext(x509, ex, -1);
X509_EXTENSION_free(ex);
}
Lock(openssl_lock);
{
// Set the public key