diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-07 20:52:58 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-07 20:52:58 +0000 |
commit | 7c46ef7c37950df4b3e7dcc61dbc00bffd6a4545 (patch) | |
tree | 748ddfab12511465c3d8c396bf5ab2eb58abc1f9 /chrome | |
parent | baa2fa68889610ed927f443323b6b6e64b78bff2 (diff) | |
download | chromium_src-7c46ef7c37950df4b3e7dcc61dbc00bffd6a4545.zip chromium_src-7c46ef7c37950df4b3e7dcc61dbc00bffd6a4545.tar.gz chromium_src-7c46ef7c37950df4b3e7dcc61dbc00bffd6a4545.tar.bz2 |
The UrlRequestAutomationJob::GetResponseInfo function needs to return a valid X509Certificate in the HttpResponseInfo structure passed in if the current URL scheme is https
Not returning this certificate causes a number of DCHECKS to fire in the network stack implementation and in the renderer process, which eventually causes the navigation to fail.
Fix is to return a dummy X509Certificate on the same lines as Gears.
This fixes bug http://b/issue?id=2039699
Bug=2039699
Review URL: http://codereview.chromium.org/164110
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/automation/url_request_automation_job.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc index cc4e2df2..4b69cca 100644 --- a/chrome/browser/automation/url_request_automation_job.cc +++ b/chrome/browser/automation/url_request_automation_job.cc @@ -5,6 +5,7 @@ #include "chrome/browser/automation/url_request_automation_job.h" #include "base/message_loop.h" +#include "base/time.h" #include "chrome/browser/automation/automation_resource_message_filter.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/resource_dispatcher_host.h" @@ -15,6 +16,8 @@ #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" +using base::Time; +using base::TimeDelta; // The list of filtered headers that are removed from requests sent via // StartAsync(). These must be lower case. @@ -156,7 +159,19 @@ void URLRequestAutomationJob::GetResponseInfo(net::HttpResponseInfo* info) { if (headers_) info->headers = headers_; if (request_->url().SchemeIsSecure()) { - // TODO(joshia): fill up SSL related fields. + // Make up a fake certificate for this response since we don't have + // access to the real SSL info. + const char* kCertIssuer = "Chrome Internal"; + const int kLifetimeDays = 100; + + info->ssl_info.cert = + new net::X509Certificate(request_->url().GetWithEmptyPath().spec(), + kCertIssuer, + Time::Now(), + Time::Now() + + TimeDelta::FromDays(kLifetimeDays)); + info->ssl_info.cert_status = 0; + info->ssl_info.security_bits = 0; } } |