<?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>185522</bug_id>
          
          <creation_ts>2018-05-10 11:49:37 -0700</creation_ts>
          <short_desc>NetworkCORSPreflightChecker should proceed when having a ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested challenge</short_desc>
          <delta_ts>2018-05-23 10:45:50 -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>WebKit Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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>
          
          <blocked>185840</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="youenn fablet">youennf</reporter>
          <assigned_to name="youenn fablet">youennf</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1422801</commentid>
    <comment_count>0</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-05-10 11:49:37 -0700</bug_when>
    <thetext>NetworkCORSPreflightChecker should proceed when having a ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested challenge</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1422802</commentid>
    <comment_count>1</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-05-10 11:50:02 -0700</bug_when>
    <thetext>&lt;rdar://problem/39987152&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1422807</commentid>
    <comment_count>2</comment_count>
      <attachid>340114</attachid>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-05-10 11:55:56 -0700</bug_when>
    <thetext>Created attachment 340114
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1422882</commentid>
    <comment_count>3</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-05-10 14:38:41 -0700</bug_when>
    <thetext>Testing of this feature would require writing an API test using an HTTP server.
It would also require that the certificate would be valid.

This patch is also missing the ability to let the certificates be validated by UIProcess when the connection is created by the preflight request.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1422920</commentid>
    <comment_count>4</comment_count>
      <attachid>340114</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2018-05-10 16:02:39 -0700</bug_when>
    <thetext>Comment on attachment 340114
Patch

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

This looks correct to me. r=me.

&gt; Source/WebKit/ChangeLog:10
&gt; +        Previously, we were failing right away which is not right in case preflight is the request triggering the connection.

If the issue is that preflight doesn&apos;t use credentials, couldn&apos;t this be an issue with any of the authentication scheme&apos;s needing credentials (e.g., ProtectionSpaceAuthenticationSchemeClientCertificateRequested)? Or is it something special about the behavior of ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested?

Looking through the rest of the code, it seems like ServerTrust is handled specially and rejects as you propose here in similar cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1423066</commentid>
    <comment_count>5</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-05-10 23:54:54 -0700</bug_when>
    <thetext>Thanks for the review.

&gt; If the issue is that preflight doesn&apos;t use credentials, couldn&apos;t this be an
&gt; issue with any of the authentication scheme&apos;s needing credentials (e.g.,
&gt; ProtectionSpaceAuthenticationSchemeClientCertificateRequested)? Or is it
&gt; something special about the behavior of
&gt; ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested?

My understanding is that with other authentication schemes, the browser receives a 401.
This is then transmitted to the preflight checker which always fail.

In the case of ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested, we must react appropriately to the fact that the connection is credential-less.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1423067</commentid>
    <comment_count>6</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2018-05-10 23:56:38 -0700</bug_when>
    <thetext>I still wonder whether we should validate server certificates like we do for regular loads.
There is an option to do that within network process, which would be easier to implement although we could consider doing the full path to UIProcess for consistency.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1423072</commentid>
    <comment_count>7</comment_count>
      <attachid>340114</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-05-11 00:22:17 -0700</bug_when>
    <thetext>Comment on attachment 340114
Patch

Clearing flags on attachment: 340114

Committed r231694: &lt;https://trac.webkit.org/changeset/231694&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1423073</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-05-11 00:22:19 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>340114</attachid>
            <date>2018-05-10 11:55:56 -0700</date>
            <delta_ts>2018-05-11 00:22:17 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-185522-20180510205554.patch</filename>
            <type>text/plain</type>
            <size>2673</size>
            <attacher name="youenn fablet">youennf</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjMxNTUyCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0L0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCmluZGV4IDUwZDcwMzRmYWI1MGM3YTU1
ZjgyM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