<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>155132</bug_id>
          
          <creation_ts>2016-03-07 13:51:47 -0800</creation_ts>
          <short_desc>Regression tests cannot load video over HTTPS with self-signed certificate</short_desc>
          <delta_ts>2020-07-16 12:05:18 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Local Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Bates">dbates</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>hector_i_lopez</cc>
    
    <cc>jer.noble</cc>
    
    <cc>lforschler</cc>
    
    <cc>tsavell</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1171731</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2016-03-07 13:51:47 -0800</bug_when>
    <thetext>The test LayoutTests/http/tests/security/contentSecurityPolicy/video-with-https-url-allowed-by-csp-media-src-star.html, included in the attachment #273068 (bug #154122), fails when run using run-webkit-tests on OS X 10.11.3 (15D19) with the following console output:

3/7/16 1:49:58.938 PM com.apple.WebKit.WebContent.Development[63455]: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
3/7/16 1:49:58.940 PM com.apple.WebKit.WebContent.Development[63455]: [13:49:58.940] HTTPRequest figHttpRequestDidFailCallback: Network error: domain=kCFErrorDomainCFNetwork, code=-1202, Error Domain=kCFErrorDomainCFNetwork Code=-1202 &quot;The certificate for this server is invalid. You might be connecting to a server that is pretending to be �127.0.0.1� which could put your confidential information at risk.&quot; UserInfo={NSErrorFailingURLStringKey=https://127.0.0.1:8443/media-resources/content/test.mp4, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9813, kCFStreamPropertySSLPeerCertificates=(
    &quot;&lt;SecCertificate 0x7fd872b85bc0 [0x7fff7ae80440]&gt;&quot;
), _kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=&lt;SecTrust 0x7fd872b87310 [0x7fff7ae80440]&gt;, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be �127.0.0.1� which could put your confidential information at risk., _kCFStreamErrorDomainKey=3, NSErrorFailingURLKey=https://127.0.0.1:8443/media-resources/content/test.mp4, _kCFStreamErrorCodeKey=-9813} for https://127.0.0.1:8443/media-resources/content/test.mp4

Notice that the certificate for https://127.0.0.1:8443 is a self-signed certificate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1209070</commentid>
    <comment_count>1</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2016-07-08 06:00:22 -0700</bug_when>
    <thetext>The same problem happens for some web-platform-tests tests, for instance imported/w3c/web-platform-tests/fetch/api/cors/cors-basic.html

The stderr is:
2016-07-08 14:45:32.887 com.apple.WebKit.Networking.Development[83486:12370795] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2016-07-08 14:45:32.907 com.apple.WebKit.Networking.Development[83486:12370795] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2016-07-08 14:45:32.911 com.apple.WebKit.Networking.Development[83486:12370795] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

I tried using testRunner.setAllowsAnySSLCertificate.
It seems to work only for DRT, not WTR. Is this a known bug?

Web-platform-tests server is now always reusing the same certificate, like httpd.
Maybe there is a way to register wpt and httpd certificates to DRT and WTR?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1209150</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-07-08 09:42:31 -0700</bug_when>
    <thetext>&gt; It seems to work only for DRT, not WTR. Is this a known bug?

Yes. The good news is that it should work on macOS Sierra.

The way it works is that in DumpRenderTree, we set a global NSURLConnection setting (via +[NSURLRequest setAllowsAnyHTTPSCertificate:forHost:]), so any loads in the process are affected by it. In WebKitTestRunner, we use a proper delegate based solution, but that means that only network loads performed by WebKit are affected. Media loads used to bypass WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1217817</commentid>
    <comment_count>3</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2016-08-04 23:34:49 -0700</bug_when>
    <thetext>I hit this bug again as part of bug 160445.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672199</commentid>
    <comment_count>4</comment_count>
      <attachid>404471</attachid>
    <who name="Hector Lopez">hector_i_lopez</who>
    <bug_when>2020-07-16 11:36:31 -0700</bug_when>
    <thetext>Created attachment 404471
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672200</commentid>
    <comment_count>5</comment_count>
    <who name="Truitt Savell">tsavell</who>
    <bug_when>2020-07-16 11:45:11 -0700</bug_when>
    <thetext>This test http/tests/security/contentSecurityPolicy/video-with-https-url-allowed-by-csp-media-src-star.html 

is passing on all of Mac according to history: 
https://results.webkit.org/?suite=layout-tests&amp;test=http%2Ftests%2Fsecurity%2FcontentSecurityPolicy%2Fvideo-with-https-url-allowed-by-csp-media-src-star.html

We are removing the expectations</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672201</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2020-07-16 12:05:00 -0700</bug_when>
    <thetext>Committed r264472: &lt;https://trac.webkit.org/changeset/264472&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404471.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672202</commentid>
    <comment_count>7</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-07-16 12:05:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/65681397&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>404471</attachid>
            <date>2020-07-16 11:36:31 -0700</date>
            <delta_ts>2020-07-16 12:05:01 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-155132-20200716113631.patch</filename>
            <type>text/plain</type>
            <size>1647</size>
            <attacher name="Hector Lopez">hector_i_lopez</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjY0NDcxCmRpZmYgLS1naXQgYS9MYXlvdXRUZXN0cy9DaGFu
Z2VMb2cgYi9MYXlvdXRUZXN0cy9DaGFuZ2VMb2cKaW5kZXggOWQ4YzM3Zjc5Y2FhZWUzYThlYzA3
M2Y2M2I3ZWM0NmM4MjJiNTM2MC4uNTAzMmMzY2NiMTI3ZGRlYWQwNGU3ODQxYzIxNjEyYThjOGRj
MWE1ZiAxMDA2NDQKLS0tIGEvTGF5b3V0VGVzdHMvQ2hhbmdlTG9nCisrKyBiL0xheW91dFRlc3Rz
L0NoYW5nZUxvZwpAQCAtMSwzICsxLDEyIEBACisyMDIwLTA3LTE2ICBIZWN0b3IgTG9wZXogIDxo
ZWN0b3JfaV9sb3BlekBhcHBsZS5jb20+CisKKyAgICAgICAgUmVncmVzc2lvbiB0ZXN0cyBjYW5u
b3QgbG9hZCB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