WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
192937
Move HTTPS_UPGRADE code behind a runtime flag, off by default
https://bugs.webkit.org/show_bug.cgi?id=192937
Summary
Move HTTPS_UPGRADE code behind a runtime flag, off by default
Chris Dumez
Reported
2018-12-20 09:19:38 PST
Move HTTP_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
Attachments
Patch
(20.39 KB, patch)
2018-12-20 09:42 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(19.52 KB, patch)
2018-12-20 09:45 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(19.53 KB, patch)
2018-12-20 09:53 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(20.52 KB, patch)
2018-12-20 10:03 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(20.92 KB, patch)
2018-12-20 10:34 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(20.93 KB, patch)
2018-12-20 10:54 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(21.70 KB, patch)
2018-12-20 11:41 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(20.36 KB, patch)
2018-12-20 15:56 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(20.36 KB, patch)
2018-12-20 15:57 PST
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(8)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2018-12-20 09:42:40 PST
Created
attachment 357821
[details]
Patch
Chris Dumez
Comment 2
2018-12-20 09:45:06 PST
Created
attachment 357823
[details]
Patch
Chris Dumez
Comment 3
2018-12-20 09:53:23 PST
Created
attachment 357826
[details]
Patch
Chris Dumez
Comment 4
2018-12-20 10:03:26 PST
Created
attachment 357827
[details]
Patch
Chris Dumez
Comment 5
2018-12-20 10:12:02 PST
make: *** No rule to make target `HTTPSUpgradeList.txt', needed by `HTTPSUpgradeList.db'. Stop. make: *** Waiting for unfinished jobs.... Command /bin/sh failed with exit code 2 :/
Chris Dumez
Comment 6
2018-12-20 10:15:56 PST
Comment on
attachment 357827
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=357827&action=review
> Source/WebKit/DerivedSources.make:320 > HTTPSUpgradeList.db : HTTPSUpgradeList.txt $(WebKit2)/Scripts/generate-https-upgrade-database.sh
Should this be in WebKitDerivedSourcesAdditions.make ?
Andy Estes
Comment 7
2018-12-20 10:19:48 PST
(In reply to Chris Dumez from
comment #6
)
> Comment on
attachment 357827
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=357827&action=review
> > > Source/WebKit/DerivedSources.make:320 > > HTTPSUpgradeList.db : HTTPSUpgradeList.txt $(WebKit2)/Scripts/generate-https-upgrade-database.sh > > Should this be in WebKitDerivedSourcesAdditions.make ?
Yes.
Chris Dumez
Comment 8
2018-12-20 10:34:15 PST
Created
attachment 357830
[details]
Patch
Vivek Seth
Comment 9
2018-12-20 10:46:27 PST
Comment on
attachment 357830
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=357830&action=review
> Source/WebKit/Shared/HTTPSUpgrade/HTTPSUpgradeList.txt:1 > +www.bbc.com
Should we use a larger list of domains from the HSTS list?
Chris Dumez
Comment 10
2018-12-20 10:54:09 PST
Created
attachment 357833
[details]
Patch
Vivek Seth
Comment 11
2018-12-20 11:01:37 PST
Comment on
attachment 357833
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=357833&action=review
> Source/WebKit/DerivedSources.make:319 > +VPATH += $(WebKit2)/Shared/HTTPSUpgrade/
I thought we were adding this to WebKitDerivedSourcesAdditions.make. Did that not work?
Vivek Seth
Comment 12
2018-12-20 11:24:42 PST
> /Volumes/Data/EWS/WebKit/Source/WebKit/NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:95> :13: error: unused variable 'bindTextResult' [-Werror,-Wunused-variable] > int bindTextResult = m_statement->bindText(1, WTFMove(host)); > ^ > /Volumes/Data/EWS/WebKit/Source/WebKit/NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:10> 1:13: error: unused variable 'resetResult' [-Werror,-Wunused-variable] > int resetResult = m_statement->reset(); > ^ > 2 errors generated.
This was my mistake, ASSERTS are compiled out on release builds. I didn't realize unused variables would cause errors. Here is one solution: void NetworkHTTPSUpgradeChecker::query(String&& host, CompletionHandler<void(bool)>&& callback) { ASSERT(isMainThread()); if (!this->m_isSetupComplete) { RELEASE_LOG_IF_ALLOWED("query - database setup is not complete, ignoring query."); callback(false); return; } m_workQueue->dispatch([this, host = WTFMove(host), callback = WTFMove(callback)] () mutable { auto runCallbackOnMainThread = [callback = WTFMove(callback)] (bool foundHost) mutable { WTF::RunLoop::main().dispatch([foundHost, callback = WTFMove(callback)] () mutable { callback(foundHost); }); }; if (this->m_statement->bindText(1, WTFMove(host)) != SQLITE_OK) { ASSERT(false); runCallbackOnMainThread(false); return; } int stepResult = this->m_statement->step(); if (stepResult != SQLITE_ROW && stepResult != SQLITE_DONE) { ASSERT(false); runCallbackOnMainThread(false); return; } if (this->m_statement->reset() != SQLITE_OK) { ASSERT(false); runCallbackOnMainThread(false); return; } bool foundHost = (stepResult == SQLITE_ROW); RELEASE_LOG_IF_ALLOWED("query - Ran successfully. Result = %s", (foundHost ? "true" : "false")); runCallbackOnMainThread(foundHost); }); }
Chris Dumez
Comment 13
2018-12-20 11:41:36 PST
Created
attachment 357841
[details]
Patch
Chris Dumez
Comment 14
2018-12-20 11:43:09 PST
(In reply to Vivek Seth from
comment #11
)
> Comment on
attachment 357833
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=357833&action=review
> > > Source/WebKit/DerivedSources.make:319 > > +VPATH += $(WebKit2)/Shared/HTTPSUpgrade/ > > I thought we were adding this to WebKitDerivedSourcesAdditions.make. Did > that not work?
I haven't tried, I thought it'd be better to have a minimal db in OpenSource.
Vivek Seth
Comment 15
2018-12-20 12:14:26 PST
Comment on
attachment 357833
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=357833&action=review
>>> Source/WebKit/DerivedSources.make:319 >>> +VPATH += $(WebKit2)/Shared/HTTPSUpgrade/ >> >> I thought we were adding this to WebKitDerivedSourcesAdditions.make. Did that not work? > > I haven't tried, I thought it'd be better to have a minimal db in OpenSource.
Yeah that would be good.
Vivek Seth
Comment 16
2018-12-20 14:59:24 PST
Comment on
attachment 357841
[details]
Patch Looks good to me!
youenn fablet
Comment 17
2018-12-20 15:50:00 PST
Comment on
attachment 357841
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=357841&action=review
> Source/WebKit/NetworkProcess/PingLoad.cpp:46 > + , m_networkLoadChecker(makeUniqueRef<NetworkLoadChecker>(FetchOptions { m_parameters.options}, m_parameters.sessionID, m_parameters.webPageID, m_parameters.webFrameID, WTFMove(m_parameters.originalRequestHeaders), URL { m_parameters.request.url() }, m_parameters.sourceOrigin.copyRef(), m_parameters.preflightPolicy, false, m_parameters.request.httpReferrer()))
Not very clear what false means here. Maybe isHTTPSUpgradeEnabled should be the last parameter and set to false by default, like requestLoadType.
Andy Estes
Comment 18
2018-12-20 15:52:23 PST
Comment on
attachment 357841
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=357841&action=review
> Source/WebKit/DerivedSources.make:319 > -ifeq ($(ENABLE_HTTPS_UPGRADE),ENABLE_HTTPS_UPGRADE) > +VPATH += $(WebKit2)/Shared/HTTPSUpgrade/
Nice
> Source/WebKit/Shared/HTTPSUpgrade/HTTPSUpgradeList.txt:3 > +www.bbc.com > +www.speedtest.net > +www.bea.gov
webkit.org?
> Source/WebKit/Shared/WebPreferences.yaml:42 > + humanReadableDescription: "Automatic HTTPS upgrade for sites that support it"
For the sites that we know about, at least :)
Chris Dumez
Comment 19
2018-12-20 15:56:01 PST
Created
attachment 357886
[details]
Patch
Chris Dumez
Comment 20
2018-12-20 15:57:42 PST
Created
attachment 357888
[details]
Patch
WebKit Commit Bot
Comment 21
2018-12-20 16:20:29 PST
Comment on
attachment 357888
[details]
Patch Clearing flags on attachment: 357888 Committed
r239474
: <
https://trac.webkit.org/changeset/239474
>
WebKit Commit Bot
Comment 22
2018-12-20 16:20:31 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 23
2018-12-20 16:21:35 PST
<
rdar://problem/46887131
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug