intiailse platform clientcertstore

This commit is contained in:
deepak1556 2015-06-08 21:37:48 +05:30
parent 51bb357405
commit 3ac3a2f115
2 changed files with 23 additions and 0 deletions

View file

@ -149,6 +149,7 @@
'_LARGEFILE_SOURCE',
'_LARGEFILE64_SOURCE',
'_FILE_OFFSET_BITS=64',
'USE_OPENSSL',
],
'cflags_cc': [
'-D__STRICT_ANSI__',

View file

@ -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<net::ClientCertStore> CreateClientCertStore() override {
#if defined(USE_NSS_CERTS)
return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS(
net::ClientCertStoreNSS::PasswordDelegateFactory()));
#elif defined(OS_WIN)
return scoped_ptr<net::ClientCertStore>(new net:ClientCertStoreWin());
#elif defined(OS_MACOSX)
return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreMac());
#elif defined(USE_OPENSSL)
return scoped_ptr<net::ClientCertStore>();
#endif
}
URLRequestContextGetter* getter_;
};