#include <cryptuiapi.h>
+#define dlg_title L"OpenSSL Application SSL Client Certificate Selection"
+#define dlg_prompt L"Select a certificate to use for authentication"
+
static int client_cert_select(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs)
{
X509 *x;
PCCERT_CONTEXT cert;
CAPI_CTX *ctx;
CAPI_KEY *key;
+ HWND hwnd;
int i, idx = -1;
ctx = ENGINE_get_ex_data(e, capi_idx);
/* Create an in memory store of certificates */
}
}
+ hwnd = GetActiveWindow();
+ if (!hwnd)
+ hwnd = GetConsoleWindow();
/* Call dialog to select one */
- cert = CryptUIDlgSelectCertificateFromStore(dstore, NULL,NULL, NULL,
+ cert = CryptUIDlgSelectCertificateFromStore(dstore, hwnd,
+ dlg_title, dlg_prompt,
0, 0, NULL);
/* Find matching cert from list */