Index: engines/e_capi.c
===================================================================
--- engines/e_capi.c (revision 839)
+++ engines/e_capi.c (working copy)
@@ -57,7 +57,10 @@
#include <openssl/crypto.h>
#include <openssl/buffer.h>
#include <openssl/bn.h>
+#include <shlwapi.h>
+#pragma comment(lib, "shlwapi.lib")
+
#ifdef OPENSSL_SYS_WIN32
#ifndef OPENSSL_NO_CAPIENG
@@ -575,6 +578,26 @@
void ENGINE_load_capi(void)
{
+ DWORD dwType = 0;
+ DWORD dwData = 0;
+ DWORD dwDataSize = 4;
+ int bLoad = 1;
+#ifdef _WIN64
+ if (SHGetValue(HKEY_CURRENT_USER, L"Software\\TortoiseSVN", L"OpenSSLCapi", &dwType, &dwData, &dwDataSize) == ERROR_SUCCESS)
+#else
+ if (SHGetValue(HKEY_CURRENT_USER, "Software\\TortoiseSVN", "OpenSSLCapi", &dwType, &dwData, &dwDataSize) == ERROR_SUCCESS)
+#endif
+ {
+ if (dwType == REG_DWORD)
+ {
+ if (dwData == 0)
+ {
+ bLoad = 0;
+ }
+ }
+ }
+ if (bLoad)
+ {
/* Copied from eng_[openssl|dyn].c */
ENGINE *toadd = engine_capi();
if(!toadd) return;
@@ -582,6 +605,7 @@
ENGINE_free(toadd);
ERR_clear_error();
}
+ }
#endif
@@ -1734,8 +1758,10 @@
static int cert_select_simple(ENGINE *e, SSL *ssl, STACK_OF(X509) *certs)
{
- return 0;
- }
+ if (sk_X509_num(certs) == 1)
+ return 0;
+ return -1; /* let TSVN decide which certificate to use */
+ }
#ifdef OPENSSL_CAPIENG_DIALOG