Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run flutter web application locally with https?

I built flutter application for web. And able to launch the app using the below command.

flutter run -d chrome

But the above command launches my web app in chrome with http://localhost:59111. I need to test web application in https:// not with http://

Can anyone suggest me to launch web app with https:// localhost.

like image 418
Raghu Mudem Avatar asked Apr 09 '26 12:04

Raghu Mudem


1 Answers

You can use mkcert to mock a trusted certificate while testing locally using localhost. mkcert automatically creates and installs a local Certificate Authority (CA), and generates locally-trusted certificates.

Follow this guide to install mkcert. On macOS, this can be installed using Homebrew.

brew 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.

like image 71
Omatt Avatar answered Apr 12 '26 12:04

Omatt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!