intiailse platform clientcertstore
This commit is contained in:
parent
51bb357405
commit
3ac3a2f115
2 changed files with 23 additions and 0 deletions
|
@ -149,6 +149,7 @@
|
||||||
'_LARGEFILE_SOURCE',
|
'_LARGEFILE_SOURCE',
|
||||||
'_LARGEFILE64_SOURCE',
|
'_LARGEFILE64_SOURCE',
|
||||||
'_FILE_OFFSET_BITS=64',
|
'_FILE_OFFSET_BITS=64',
|
||||||
|
'USE_OPENSSL',
|
||||||
],
|
],
|
||||||
'cflags_cc': [
|
'cflags_cc': [
|
||||||
'-D__STRICT_ANSI__',
|
'-D__STRICT_ANSI__',
|
||||||
|
|
|
@ -19,6 +19,15 @@
|
||||||
#include "content/public/browser/browser_thread.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
#include "content/public/browser/resource_context.h"
|
#include "content/public/browser/resource_context.h"
|
||||||
#include "content/public/browser/storage_partition.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;
|
using content::BrowserThread;
|
||||||
|
|
||||||
|
@ -41,6 +50,19 @@ class BrowserContext::ResourceContext : public content::ResourceContext {
|
||||||
return getter_->GetURLRequestContext();
|
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_;
|
URLRequestContextGetter* getter_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue