<?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>284559</bug_id>
          
          <creation_ts>2024-12-12 08:42:22 -0800</creation_ts>
          <short_desc>Safari 18.2 non-secure site connections warning blocks localhost with no option to proceed</short_desc>
          <delta_ts>2026-06-04 15:28:10 -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>Page Loading</component>
          <version>Safari 18</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=284834</see_also>
          <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="Jeff Johnson">opendarwin</reporter>
          <assigned_to name="Matthew Finkel">m_finkel</assigned_to>
          <cc>beidson</cc>
    
    <cc>fredrickbishop14</cc>
    
    <cc>karlcow</cc>
    
    <cc>martijn</cc>
    
    <cc>m_finkel</cc>
    
    <cc>mohit.n</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wilander</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2081217</commentid>
    <comment_count>0</comment_count>
      <attachid>473554</attachid>
    <who name="Jeff Johnson">opendarwin</who>
    <bug_when>2024-12-12 08:42:22 -0800</bug_when>
    <thetext>Created attachment 473554
Sample html to reproduce the bug

Steps to reproduce:
1) Open Safari 18.2
2) In Safari Security Settings, enable &quot;Warn before connecting to a website over HTTP&quot;
3) Download the attached index.html file
4) In Terminal, cd ~/Downloads; /usr/bin/python3 -m http.server
5) In Terminal, open -a Safari &apos;http://localhost:8000&apos;

Expected results: &quot;This Connection Is Not Secure&quot; warning, with options to Continue or Go Back

Actual results: Safari can&apos;t open the page &quot;http://localhost:8000/&quot;. The error is: &quot;Navigation failed because the request was for an HTTP URL with HTTPS-Only enabled&quot; (WebKitErrorDomain:305)

Notes: This is the new Safari 18.2 feature described at https://webkit.org/blog/16301/webkit-features-in-safari-18-2/#security-and-privacy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2081971</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-12-15 23:23:40 -0800</bug_when>
    <thetext>&lt;rdar://problem/141532147&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2097899</commentid>
    <comment_count>3</comment_count>
    <who name="John Wilander">wilander</who>
    <bug_when>2025-02-25 12:39:14 -0800</bug_when>
    <thetext>Hi! Thanks for filing!

Can you manually enter &apos;http://localhost:8000&apos; in the URL bar, including the scheme http://, and then load the page?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2098010</commentid>
    <comment_count>4</comment_count>
    <who name="Jeff Johnson">opendarwin</who>
    <bug_when>2025-02-25 15:37:10 -0800</bug_when>
    <thetext>(In reply to John Wilander from comment #3)
&gt; Hi! Thanks for filing!
&gt; 
&gt; Can you manually enter &apos;http://localhost:8000&apos; in the URL bar, including the
&gt; scheme http://, and then load the page?

Yes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2098013</commentid>
    <comment_count>5</comment_count>
    <who name="John Wilander">wilander</who>
    <bug_when>2025-02-25 16:00:33 -0800</bug_when>
    <thetext>OK, so then there&apos;s at least a workaround for now. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2098833</commentid>
    <comment_count>6</comment_count>
    <who name="John Wilander">wilander</who>
    <bug_when>2025-02-27 10:49:37 -0800</bug_when>
    <thetext>Note that that is a deliberate thing. Explicitly stating a plaintext scheme should allow loading it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2122099</commentid>
    <comment_count>7</comment_count>
    <who name="">martijn</who>
    <bug_when>2025-06-06 00:31:32 -0700</bug_when>
    <thetext>To add to this. Somehow, on one of my machines (Safari 18.5), localhost got in a state where it won&apos;t load in Safari anymore:

    Safari can&apos;t open the page &quot;http://localhost:3000/&quot;. 
    The error is: &quot;Navigation failed because the request was for an HTTP URL with HTTPS-Only enabled&quot; (WebKitErrorDomain:305)

This happened consistently when I typed &quot;L&quot; in the address bar and confirmed the autocomplete.
Now since I typed the full address, also with http:// it worked, and the problem disappeared for autocomplete, too.

However, as with the original bug report, when following a http://localhost:3000/ link, it still blocks.

Removing website data for localhost doesn&apos;t accomplish anything for this problem (this is a common suggestion on the web) and apparently there&apos;s no way (anymore) to remove the HSTS cache for Safari - if that&apos;s even relevant.

So far, this is probably exactly the same as the original post.

What I did notice is that when I close the tab presenting the error, and then Cmd+Z to reopen the tab, it always loads.

I would expect:
- this blocking to never happen for localhost
- that there is a documented way to break through the blockade (permanently)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2212197</commentid>
    <comment_count>8</comment_count>
    <who name="Matthew Finkel">m_finkel</who>
    <bug_when>2026-05-19 15:01:22 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/65222</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2217765</commentid>
    <comment_count>9</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-06-04 15:28:08 -0700</bug_when>
    <thetext>Committed 314584@main (f219b0a165b6): &lt;https://commits.webkit.org/314584@main&gt;

Reviewed commits have been landed. Closing PR #65222 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>473554</attachid>
            <date>2024-12-12 08:42:22 -0800</date>
            <delta_ts>2024-12-12 08:42:22 -0800</delta_ts>
            <desc>Sample html to reproduce the bug</desc>
            <filename>index.html</filename>
            <type>text/html</type>
            <size>113</size>
            <attacher name="Jeff Johnson">opendarwin</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPHRpdGxlPmxvY2FsaG9zdCBidWc8L3RpdGxl
Pgo8L2hlYWQ+Cjxib2R5Pgo8aDE+bG9jYWxob3N0IGJ1ZzwvaDE+CjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>