Enable SSL for API URL in Local Development
Hello friends!
Would anyone know how to enable https for the API URL in local development?
In case helpful:
azharc@Jelly ~> curl -v https://localhost:54321
* Trying 127.0.0.1:54321...
* Connected to localhost (127.0.0.1) port 54321 (#0)
* ALPN: offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/cert.pem
* CApath: none
* LibreSSL/3.3.6: error:1404B42E:SSL routines:ST_CONNECT:tlsv1 alert protocol version
* Closing connection 0
curl: (35) LibreSSL/3.3.6: error:1404B42E:SSL routines:ST_CONNECT:tlsv1 alert protocol version
If I change the .env to use https, getting SSL errors in the browser.
Any help would be appreciated 🙏3 Replies
Is there some reason you want to do this? Normally for local dev you just use http. I don't know if there is any documentation or not but I assume you would need a TLS certificate.
Hey Gary – yeah, I am working on something that uses the Geolocation API, and it only works in an HTTPS context. So when I have Vite implement SSL, the Supabase requests fail because they aren't secure. Ultimately, just used a browser-based workaround using Chrome Flags: chrome://flags/#unsafely-treat-insecure-origin-as-secure
FWIW nHost's local environment is all HTTPS (maybe because there are more use cases out there like this)
