10

I'm trying to port an App I made with Flutter for Android and iOS and run it on web as well. Due to the fact that I use Google and Facebook login frameworks there is a need to use an 'https' address even that the original url is localhost. I'm using the Web Server run option which runs the app in the build in web server inside Android Studio.

I'm running the web app currently using the following command from the command line:

flutter run -d web-server --web-hostname=`hostname` --web-port=8080 --profile -v

And using the port that I specified in the Google API Console, but I'm still failing to authenticate in one of the platforms due to the fact that I'm not using an 'https' and the connection is not secured.

Has any one encountered this issue and know how this can be resolved? I would greatly appreciate any help you can provide on the matter.

1 Answer 1

0

You can use mkcert to create a certificate and sign it with a Certificate Authority (CA) that is trusted locally by your device and browser.

Follow this guide to install mkcert. Run mkcert -install on the terminal to create a new local certificate authority using mkcert. Then run mkcert localhost - this makes all localhost address trusted. Other samples are demonstrated in here.

As for this feature to be directly baked into the Flutter plugin, there's an active feature request on GitHub that you can track.

Sign up to request clarification or add additional context in comments.

1 Comment

Can you explain please how to do it? I already created the certificate for localhost, now what do I do? I tried manually inputting https://localhost:8080 but this doesn't work

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.