From 3ac3a2f115b432cc7334e229c045d1e809c3454b Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Mon, 8 Jun 2015 21:37:48 +0530 Subject: [PATCH] intiailse platform clientcertstore --- brightray/brightray.gypi | 1 + brightray/browser/browser_context.cc | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/brightray/brightray.gypi b/brightray/brightray.gypi index 47be6215dc31..97f4f4a3a2f7 100644 --- a/brightray/brightray.gypi +++ b/brightray/brightray.gypi @@ -149,6 +149,7 @@ '_LARGEFILE_SOURCE', '_LARGEFILE64_SOURCE', '_FILE_OFFSET_BITS=64', + 'USE_OPENSSL', ], 'cflags_cc': [ '-D__STRICT_ANSI__', diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index 3e0e271164bf..40f187b6404c 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -19,6 +19,15 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/resource_context.h" #include "content/public/browser/storage_partition.h" +#include "net/ssl/client_cert_store.h" + +#if defined(USE_NSS_CERTS) +#include "net/ssl/client_cert_store_nss.h" +#elif defined(OS_WIN) +#include "net/ssl/client_cert_store_win.h" +#elif defined(OS_MACOSX) +#include "net/ssl/client_cert_store_mac.h" +#endif using content::BrowserThread; @@ -41,6 +50,19 @@ class BrowserContext::ResourceContext : public content::ResourceContext { return getter_->GetURLRequestContext(); } + scoped_ptr CreateClientCertStore() override { + #if defined(USE_NSS_CERTS) + return scoped_ptr(new net::ClientCertStoreNSS( + net::ClientCertStoreNSS::PasswordDelegateFactory())); + #elif defined(OS_WIN) + return scoped_ptr(new net:ClientCertStoreWin()); + #elif defined(OS_MACOSX) + return scoped_ptr(new net::ClientCertStoreMac()); + #elif defined(USE_OPENSSL) + return scoped_ptr(); + #endif + } + URLRequestContextGetter* getter_; };