Bug 175147 - [Win] DRT should only allow any https certificate for localhost.
Summary: [Win] DRT should only allow any https certificate for localhost.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Windows 10
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-03 12:38 PDT by Per Arne Vollan
Modified: 2017-11-17 14:37 PST (History)
6 users (show)

See Also:


Attachments
Patch (3.27 KB, patch)
2017-08-03 13:13 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (3.29 KB, patch)
2017-08-03 13:21 PDT, Per Arne Vollan
bfulgham: review+
bfulgham: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2017-08-03 12:38:41 PDT
The same restriction is enforced on macOS.
Comment 1 Per Arne Vollan 2017-08-03 13:13:26 PDT
Created attachment 317142 [details]
Patch
Comment 2 Per Arne Vollan 2017-08-03 13:21:04 PDT
Created attachment 317144 [details]
Patch
Comment 3 Alexey Proskuryakov 2017-08-03 15:04:56 PDT
Comment on attachment 317144 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=317144&action=review

> Source/WebCore/ChangeLog:3
> +        [Win] DRT should only allow any https certificate for localhost.

Is SSL completely broken on Windows? There is a change in WebCore, what is its impact other than on testing?
Comment 4 Per Arne Vollan 2017-08-03 15:37:51 PDT
(In reply to Alexey Proskuryakov from comment #3)
> Comment on attachment 317144 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=317144&action=review
> 
> > Source/WebCore/ChangeLog:3
> > +        [Win] DRT should only allow any https certificate for localhost.
> 
> Is SSL completely broken on Windows? There is a change in WebCore, what is
> its impact other than on testing?

SSL works on Windows, but SSL tests are failing because the layout test certificate has expired. To work around this, I recently committed a change to allow any https certificate in layout tests, but this was not enough to get SSL tests to pass, since there appears to be a bug in CFNetwork on Windows where the certificate will not be accepted when the certificate chain validation is skipped. This is addressed in this patch, and I believe it only will impact WebKit on Windows clients which allow any https certificate. It actually makes the certificate check a little stricter when any https certificate is allowed, since the certificate chain validation is not skipped with this patch.
Comment 5 Per Arne Vollan 2017-08-09 11:01:25 PDT
I believe this patch fixes ~40 layout tests :)
Comment 6 Alexey Proskuryakov 2017-08-09 12:53:31 PDT
Brent or Alex would be the best reviewers for this change I think.
Comment 7 Brent Fulgham 2017-08-18 09:28:58 PDT
Comment on attachment 317144 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=317144&action=review

r=me assuming you add the Radar reference I requested.

> Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:183
>          CFDictionaryAddValue(sslProps.get(), kCFStreamSSLValidatesCertificateChain, kCFBooleanFalse);

Is this a bug in CFNetwork on Windows? Can you add a <rdar> reference for this, if it is?

> Tools/DumpRenderTree/win/DumpRenderTree.cpp:1217
> +        request->setAllowsAnyHTTPSCertificate();

This is a harmless check, but I'm not sure it's necessary since DRT only runs against servers we specify.
Comment 8 Per Arne Vollan 2017-08-21 09:35:55 PDT
(In reply to Brent Fulgham from comment #7)
> Comment on attachment 317144 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=317144&action=review
> 
> r=me assuming you add the Radar reference I requested.
> 
> > Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:183
> >          CFDictionaryAddValue(sslProps.get(), kCFStreamSSLValidatesCertificateChain, kCFBooleanFalse);
> 
> Is this a bug in CFNetwork on Windows? Can you add a <rdar> reference for
> this, if it is?

Yes. I will add a <rdar> reference.

Thanks for reviewing!
Comment 9 Per Arne Vollan 2017-08-21 10:22:42 PDT
Committed r220970: <https://trac.webkit.org/changeset/220970/webkit>
Comment 10 Radar WebKit Bug Importer 2017-11-17 13:42:07 PST
<rdar://problem/35622830>
Comment 11 Radar WebKit Bug Importer 2017-11-17 13:42:10 PST
<rdar://problem/35622831>