Expo tunnel not working (invalid certificate)

Viewed 2931

I'd like to use expo start --tunnel to allow connecting to the App over the internet.

However, right after starting, the DevTools open and show me the following error:

Error loading DevTools

ValidationError: "urlType" must be one of [exp, http, redirect, no-protocol]

The console shows me:

Starting Metro Bundler.
Tunnel URL not found (it might not be ready yet), falling back to LAN URL.
Tunnel URL not found (it might not be ready yet), falling back to LAN URL.

So far so bad.. I've then looked into the .expo/packager-info.json to see what URLs have been generated. The file looks like this:

{
  "devToolsPort": 19002,
  "expoServerPort": 19000,
  "packagerPort": 19001,
  "packagerPid": 7316,
  "expoServerNgrokUrl": "https://sz-p2a.anonymous.123.exp.direct",
  "packagerNgrokUrl": "https://packager.sz-p2a.anonymous.123.exp.direct",
  "ngrokPid": 5316,
  "webpackServerPort": null
}

Then I've tried to open these URLs on the target devices. When doing so, I get an SSLPeerUnverifiedException because of an invalid certificate. I think it's the same error that I get when navigating to the URL directly in the browser.

So, am I doing anything wrong or is the tunnel workflow broken right now? What might I do to get it working?

2 Answers

I somehow bypassed this problem by removing https from the link.

To do so, take the expoServerNgrokUrl from .expo/packager-info.json and turn:

https://sz-p2a.anonymous.123.exp.direct

into

http://sz-p2a.anonymous.123.exp.direct

Then you can send it to any Expo device.

I had the same issue, logged out expo logout, logged in again expo login and it worked.

Related