Find certificate from Windows store using its thumbprint (replaces PR #2125) (#5023)

* Find certificate from Windows store using its thumbprint

* Address review comments

---------

Co-authored-by: Hussein Ismail <hussein.ismail@m-files.com>
This commit is contained in:
Matej Kenda
2025-09-12 11:30:28 +02:00
committed by GitHub
parent dbc800083e
commit e2920f36da
4 changed files with 78 additions and 26 deletions

View File

@@ -73,6 +73,8 @@ class NetSSL_Win_API SSLManager
/// <schannel>
/// <server|client>
/// <certificateName>cert Id</certificateName>
/// <certificateHash>cert thumbprint</certificateHash>
/// <certificatePath>path of a certificate</certificatePath>
/// <certificateStore>MY</certificateStore>
/// <verificationMode>none|relaxed|strict</verificationMode>
/// <revocationCheck>true|false</revocationCheck>
@@ -102,7 +104,9 @@ class NetSSL_Win_API SSLManager
/// for servers.
///
/// - certificateName (string): The subject name of the certificate to use. The certificate must
/// be available in the Windows user or machine certificate store.
/// be available in the Windows user or machine certificate store.
/// - certificateHash (string): The thumbprint of the certificate to use. Alternative for certificateName.
/// The certificate must be available in the Windows user or machine certificate store.
/// - certificatePath (string): The path of a certificate and private key file in PKCS #12 format.
/// - certificateStore (string): The certificate store location to use.
/// Valid values are "MY", "Root", "Trust" or "CA". Defaults to "MY".
@@ -269,6 +273,8 @@ private:
static const std::string CFG_CERT_NAME;
static const std::string VAL_CERT_NAME;
static const std::string CFG_CERT_HASH;
static const std::string VAL_CERT_HASH;
static const std::string CFG_CERT_PATH;
static const std::string VAL_CERT_PATH;
static const std::string CFG_CERT_STORE;