Bug 1553927 - Do not do immediate captive portal check on certificate/ssl errors when connecting a plain URL to prevent loops, r=valentin
authorHonza Bambas <honzab.moz@firemni.cz>
Wed, 29 May 2019 16:13:46 +0000
changeset 476357 f75360f234a978d9ed5a4e59c62d979345442e8a
parent 476356 f5a8d8e97356dcbaa021a4d82f06239af1edd538
child 476358 b6fa96d10a09ed745f77ca332075b9dfeef803c9
push id36092
push userarchaeopteryx@coole-files.de
push dateFri, 31 May 2019 17:03:46 +0000
treeherdermozilla-central@8384972e1f6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1553927
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1553927 - Do not do immediate captive portal check on certificate/ssl errors when connecting a plain URL to prevent loops, r=valentin Differential Revision: https://phabricator.services.mozilla.com/D33032
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -7820,17 +7820,17 @@ nsHttpChannel::OnStopRequest(nsIRequest*
 
   if (NS_FAILED(status)) {
     ProcessSecurityReport(status);
   }
 
   // If this load failed because of a security error, it may be because we
   // are in a captive portal - trigger an async check to make sure.
   int32_t nsprError = -1 * NS_ERROR_GET_CODE(status);
-  if (mozilla::psm::IsNSSErrorCode(nsprError)) {
+  if (mozilla::psm::IsNSSErrorCode(nsprError) && IsHTTPS()) {
     gIOService->RecheckCaptivePortal();
   }
 
   if (mTimingEnabled && request == mCachePump) {
     mCacheReadEnd = TimeStamp::Now();
 
     ReportNetVSCacheTelemetry();
   }