Fix parsing private key when empty
@@ -441,8 +441,13 @@ HRESULT Library_sys_net_native_System_Net_Security_SslNative::InitHelper(CLR_RT_
privateKey = hbCert[Library_sys_net_native_System_Security_Cryptography_X509Certificates_X509Certificate2::
FIELD___privateKey]
.DereferenceArray();
+
+ // grab the first element, if there is a private key
+ if (privateKey)
+ {
pk = privateKey->GetFirstElement();
}
+ }
// get certificate
sslCert = arrCert->GetFirstElement();
