<?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>162962</bug_id>
          
          <creation_ts>2016-10-05 02:09:23 -0700</creation_ts>
          <short_desc>[SOUP] Ensure NetworkProcess is ready before whitelisting TLS certificates</short_desc>
          <delta_ts>2017-02-02 03:30:25 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>WebKit Local 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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Emanuele Aina">emanuele.aina</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>andersca</cc>
    
    <cc>cgarcia</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>sam</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1236577</commentid>
    <comment_count>0</comment_count>
    <who name="Emanuele Aina">emanuele.aina</who>
    <bug_when>2016-10-05 02:09:23 -0700</bug_when>
    <thetext>If the API user tries to whitelist TLS certificates before any web view has been created, the action will be ignored because the NetworkProcess hasn&apos;t been fired up yet.

For example, the snippet below using the GTK+ API does not work, unless the whitelisting is moved after the web view creation:
                                                                                                                        
    webkit_web_context_allow_tls_certificate_for_host(webkit_web_context_get_default(), crt, host);
    webView = webkit_web_view_new();</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1236578</commentid>
    <comment_count>1</comment_count>
      <attachid>290698</attachid>
    <who name="Emanuele Aina">emanuele.aina</who>
    <bug_when>2016-10-05 02:11:28 -0700</bug_when>
    <thetext>Created attachment 290698
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1236634</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-10-05 08:42:51 -0700</bug_when>
    <thetext>I&apos;m not opposed to this change, but long-term we&apos;re hoping to get rid of it.  See discussion in https://bugs.webkit.org/show_bug.cgi?id=162910
Is it still wanted?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1236808</commentid>
    <comment_count>3</comment_count>
    <who name="Emanuele Aina">emanuele.aina</who>
    <bug_when>2016-10-05 15:59:45 -0700</bug_when>
    <thetext>I just stumbled on this unexpected behaviour where the whitelisting silently failed, I&apos;ll leave any other consideration to Michael and Carlos. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1236810</commentid>
    <comment_count>4</comment_count>
      <attachid>290698</attachid>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-10-05 16:01:05 -0700</bug_when>
    <thetext>Comment on attachment 290698
Patch

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

r=me, but hopefully we&apos;ll remove this whole feature soon.  You can decide if you want to land it.

&gt; w/Source/WebKit2/UIProcess/WebProcessPool.cpp:1149
&gt; +    ASSERT(m_networkProcess);

not necessary</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1236829</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-05 16:38:39 -0700</bug_when>
    <thetext>We can&apos;t remove the feature, it&apos;s part of our API and we intend to support it indefinitely. What we can do is reimplement the feature at the GTK API layer using whatever UI process callbacks get added, then it can be removed from the cross-platform WebKit2 code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1236831</commentid>
    <comment_count>6</comment_count>
      <attachid>290698</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-10-05 16:46:36 -0700</bug_when>
    <thetext>Comment on attachment 290698
Patch

Indeed, the ASSERT is not helpful here.

This looks easy to test, so if you don&apos;t want to risk it breaking in the next refactoring, it would be nice if you could try to add a test for it in TestSSL.cpp. The only trick is that you can&apos;t use the nice SSLTest class since that doesn&apos;t give you the ability to use the WebKitWebContext before the WebKitWebView is created; you&apos;d have to roll your own that inherits from Test rather than LoadTrackingTest/WebViewTest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1253122</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-11-19 17:07:15 -0800</bug_when>
    <thetext>Emanuele, I think you should commit this (without the ASSERT) even if you don&apos;t have time to write a test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262555</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-12-23 09:11:26 -0800</bug_when>
    <thetext>Did this get forgotten?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262816</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-12-27 09:57:50 -0800</bug_when>
    <thetext>Let&apos;s land this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262817</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-12-27 09:58:08 -0800</bug_when>
    <thetext>Committed r210180: &lt;http://trac.webkit.org/changeset/210180&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1272426</commentid>
    <comment_count>11</comment_count>
    <who name="Emanuele Aina">emanuele.aina</who>
    <bug_when>2017-02-02 03:30:25 -0800</bug_when>
    <thetext>I tried to come up with a test, but then I failed to find the time to finish it. Thank you for taking care of the patch!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>290698</attachid>
            <date>2016-10-05 02:11:28 -0700</date>
            <delta_ts>2016-10-05 16:46:36 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-162962-20161005110815.patch</filename>
            <type>text/plain</type>
            <size>2320</size>
            <attacher name="Emanuele Aina">emanuele.aina</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjA2ODA0CmRpZmYgLS1naXQgYy9Tb3VyY2UvV2ViS2l0Mi9D
aGFuZ2VMb2cgdy9Tb3VyY2UvV2ViS2l0Mi9DaGFuZ2VMb2cKaW5kZXggODBhOWE0YmYzODFiMGVi
YjAyNzk4NWYwMjVkMDgwMGQ2OTU2OTZmYS4uOWJmOTc4N2NjZDFiMzJjZWI1OWRjZGQyZjVkNjAy
ZjY5NjM3NGIxZSAxMDA2NDQKLS0tIGMvU291cmNlL1dlYktpdDIvQ2hhbmdlTG9nCisrKyB3L1Nv
dXJjZS9XZWJLaXQyL0NoYW5nZUxvZwpAQCAtMSwzICsxLDI2IEBACisyMDE2LTEwLTA1ICBFbWFu
dWVsZSBBaW5hICA8ZW1hbnVlbGUuYWluYUBjb2xsYWJvcmEuY29tPgorCisgICAgICAgIEVuc3Vy
ZSBOZXR3b3JrUHJvY2VzcyBpcyByZWFkeSBiZWZvcmUgd2hpdGVsaXN0aW5nIFRMUyBjZXJ0aWZp
Y2F0ZXMKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTE2
Mjk2MgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIElm
IHRoZSBBUEkgdXNlciB0cmllcyB0byB3aGl0ZWxpc3QgVExTIGNlcnRpZmljYXRlcyBiZWZvcmUg
YW55IHdlYgorICAgICAgICB2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NZXNzYWdlczo6TmV0d29y
a1Byb2Nlc3M6OkFsbG93U3BlY2lmaWNIVFRQU0NlcnRpZmljYXRlRm9ySG9zdChjZXJ0aWZpY2F0
ZS0+Y2VydGlmaWNhdGVJbmZvKCksIGhvc3QpLCAwKTsKIH0KIAogdm9pZCBXZWJQcm9jZXNzUG9v
bDo6dXBkYXRlQXV0b21hdGlvbkNhcGFiaWxpdGllcygpIGNvbnN0Cg==
</data>
<flag name="review"
          id="313863"
          type_id="1"
          status="+"
          setter="achristensen"
    />
    <flag name="commit-queue"
          id="313864"
          type_id="3"
          status="-"
          setter="mcatanzaro"
    />
          </attachment>
      

    </bug>

</bugzilla>