Issue Summary
Browsersync used to work with HTTPS, but stoped working a few weeks ago.
So, for instance, I had a localwp site at https://playground.mydomain.test, and was able to run:
browser-sync start --proxy https://playground.mydomain.test
and access the site at https://localhost:3000 (after accepting the cert warning).
But recently, that no longer works. I’m able to access https://playground.mydomain.test like before, but https://localhost:3000 spins and spins without resolving.
The only fix that’s worked has been to change the site to http://playground.mydomain.test, then run browser-sync at that non-https version: then everything works fine at http://localhost:3000. This is workable, but a hassle, as any older projects I do work on, I’m needing to replace https with http in the database before I can do work. Plus, some sites are getting ugly mixed content warnings since they rely on 3rd party https content within them. Using HTTPS everywhere, local through staging through prod, works best for my workflow.
Is there any way to get https://localhost:3000 working again?
Troubleshooting Questions
-
Does this happen for all sites in Local, or just one in particular?
All of them, old or newly created. I tried different suffixes too, like https://browsersync.something-new.net, but still have this issue. Note also that runningbrowser-sync start --https --proxy https://playground.mydomain.test
with the --https flag doesn’t change anything. Also,browser-sync start --proxy https://localwp.com
works fine for your production URL, so it’s not an issue with browser-sync and SSL per se, it’s specifically when it’s a local site served via localwp. This happens whether I’ve not trusted the cert, or if I’ve trusted it (including within keychain). -
Are you able to create a new, plain WordPress site in Local and access it in a Browser?
Yes, everything works great when accessing localwp’s site URL directly, just not via Browsersync’s HTTPS URL.
Replication
Describe the steps that others can take to replicate this issue. If you have screenshots that can help clarify what is happening, please include them!
- Create a new site on localwp.
- Install browser-sync if you don’t have it installed already.
- Run
browser-sync start --proxy https://whatever-your-site-is.test
. - Open https://localhost:3000 and notice that it never resolves, just spins on a blank screen.
System Details
-
Which version of Local is being used?
Current latest, 7.0.2+6395. -
What Operating System (OS) and OS version is being used?
macOS Ventura 13.4.1 (22F82) -
Attach the Local Log.
This is upon startup of the server, not sure if it’s helpful:
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-07-07T13:54:47.191520Z 0 [System] [MY-010116] [Server] %%resourcesPath%%/lightning-services/mysql-8.0.16+6/bin/darwin/bin/mysqld (mysqld 8.0.16) starting as process 49369","timestamp":"2023-07-07T13:54:47.438Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-07-07T13:54:47.193991Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","timestamp":"2023-07-07T13:54:47.438Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-07-07T13:54:47.194552Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for %%site.runData%%/mysql/data/ is case insensitive","timestamp":"2023-07-07T13:54:47.439Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-07-07T13:54:47.425230Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","timestamp":"2023-07-07T13:54:47.439Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-07-07T13:54:47.438209Z 0 [System] [MY-010931] [Server] %%resourcesPath%%/lightning-services/mysql-8.0.16+6/bin/darwin/bin/mysqld: ready for connections. Version: '8.0.16' socket: '%%site.runData%%/mysql/mysqld.sock' port: 10045 MySQL Community Server - GPL.","timestamp":"2023-07-07T13:54:47.439Z"}```