"Fail to verify certificate" - Local II

I’m running II locally and exposing it via ngrok (localhost:8080 via https).
I’m unable to login via II; I always get a “We couldn’t reach internet identity…we failed to call the internet identity service, please try again” error near the final step (after “confirm new device”), with error details “fail to verify certificate”.
Any ideas?

Make sure to set the II_ENV variable to develop when deploying II locally, as described in GitHub - dfinity/internet-identity: Internet Identity, a blockchain authentication system for the Internet Computer

Thanks. Yes, I’ve been running with the suggested
II_ENV=development dfx deploy --no-wallet --argument ‘(null)’
command. It only fails when ngrok gets involved (it works when everything is localhost).