From ec6304c0b2d35e5ab1e6160650f008df3c84d106 Mon Sep 17 00:00:00 2001 From: Robo Date: Tue, 13 Oct 2015 18:20:12 +0530 Subject: [PATCH] provide request context for nss_oscp initialisation --- brightray/browser/url_request_context_getter.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index 6edd4b150eb2..bf837d741e8c 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -44,6 +44,10 @@ #include "url/url_constants.h" #include "storage/browser/quota/special_storage_policy.h" +#if defined(USE_NSS_CERTS) +#include "net/cert_net/nss_ocsp.h" +#endif + using content::BrowserThread; namespace brightray { @@ -156,6 +160,9 @@ URLRequestContextGetter::URLRequestContextGetter( } URLRequestContextGetter::~URLRequestContextGetter() { +#if defined(USE_NSS_CERTS) + net::SetURLRequestContextForNSSHttpIO(NULL); +#endif } net::HostResolver* URLRequestContextGetter::host_resolver() { @@ -169,6 +176,10 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { auto& command_line = *base::CommandLine::ForCurrentProcess(); url_request_context_.reset(new net::URLRequestContext); + #if defined(USE_NSS_CERTS) + net::SetURLRequestContextForNSSHttpIO(url_request_context_.get()); + #endif + // --log-net-log net_log_->StartLogging(url_request_context_.get()); url_request_context_->set_net_log(net_log_);