Since the most recent Safari update I cannot connect to my local React apps via https
on localhost via local domain aliases anymore. However, I can access them via https://localhost:<someport>
but domain aliases result in a
Can't connect to the server
error. It used to work flawlessly in the past... → Safari.
// hosts
# The classic
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# Local dev aliases
127.0.0.1 some.local.com
::1 some.local.com
I've also created certs via mkcert
$ mkcert -install
$ mkcert "*.local.com" localhost 127.0.0.1 ::1
This seemed to work, since I do not get any https
security warnings on Chrome or FF anymore.
// webpack.config -> devServer
...
server: {
type: "https",
options: {
key: readFileSync(resolve(__dirname, "../certs/_wildcard.local.com+3-key.pem")),
cert: readFileSync(resolve(__dirname, "../certs/_wildcard.local.com+3.pem")),
ca: readFileSync("<output of mkcert -CAROOT>/rootCA.pem"),
requestCert: true,
},
},
...
https
using localhost
instead of the domain alias but unfortunately this is not an optionAny ideas? Any tips much appreciated! 🙌
Alright, found an answer even though not very satisfying.
Apple has shipped the new Safari Version (17.0) with http/3 automatically activated for "some" users. So it seems that I was one of the chosen ones but could also not find any option to disable http/3 in order to run some proper tests.
However, it seems that http/3 ignores lookups for domains listed in /etx/hosts
and thus no custom domain aliases for localhost
will work.
So my solution is running all my apps via http://localhost
.