Skip to content

Need to bundle ngrok binary in the npm package, or make it optional #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thebetterjort opened this issue Mar 14, 2017 · 6 comments
Closed

Comments

@thebetterjort
Copy link

thebetterjort commented Mar 14, 2017

We use a corporate man in the middle to decrypt network traffic. Our installed cert is self-signed and servers throw a big fit about it. When trying to run

create-react-native-app my-project

I get the following error:

/react-native-onesignal/examples/my-project/node_modules/@exponent/ngrok: Command failed.
Exit code: 1
Command: sh
Arguments: -c node ./postinstall.js
Directory: /react-native-onesignal/examples/my-project/node_modules/@exponent/ngrok
Output:
ngrok - downloading binary https://bin.equinox.io/c/6raCnPaTf2c/ngrok-beta-linux-amd64.tgz ...
stream.js:74
      throw er; // Unhandled stream error in pipe.
      ^

Error: self signed certificate in certificate chain
    at Error (native)
    at TLSSocket.<anonymous> (_tls_wrap.js:1085:38)
    at emitNone (events.js:86:13)
    at TLSSocket.emit (events.js:185:7)
    at TLSSocket._finishInit (_tls_wrap.js:603:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
`yarnpkg add --dev --exact react-native-scripts` failed


I've also set these options these commands:
npm config set strict-ssl false
yarn config set ssl strict-ssl false

@aesopwolf
Copy link

aesopwolf commented Mar 14, 2017

I don't think this is a problem with your self-signed cert or ssl, the url simple isn't available.

https://bin.equinox.io/c/6raCnPaTf2c/ngrok-beta-linux-amd64.tgz and
http://bin.equinox.io/c/6raCnPaTf2c/ngrok-beta-linux-amd64.tgz simply don't resolve.

@dikaiosune can we bundle those tgz's in the app itself so it doesn't depend on downloading them from a 3rd party with flaky uptime?

@inconshreveable anyway you can get those binaries hosted on npm? Looks like Cloudflare is down which is probably causing this issue.

Mar 14, 2017
Analytics Errors
Resolved - This incident has been resolved.
Mar 14, 12:09 UTC
Identified - CloudFlare's analytics processing infrastructure is experiencing issues. Customers may see a "1010" error when attempting to view analytics for their sites.
Mar 14, 11:52 UTC
Network Performance Issues in San Jose, CA
Resolved - This issue has been resolved and San Jose, CA has returned to normal.
Mar 14, 09:06 UTC
Monitoring - We have implemented a fix for this issue and are currently monitoring the results. We will update once we have confirmed it is resolved.
Mar 14, 05:16 UTC
Investigating - Cloudflare is observing network performance issues in San Jose, CA. We are actively working to reduce or eliminate any impact to Internet users in this region.
Mar 14, 04:41 UTC

@anp
Copy link
Contributor

anp commented Mar 15, 2017

Definitely. There are a few things that need to happen. We need to make ngrok an optional dep in one of the underlying deps (xdl), since CRNA doesn't even make use of it, and for Expo's stuff we probably also need to provide npm-based distribution of the actual binary (although I haven't looked into the licensing consequences since ngrok 2 is closed source).

@thebetterjort
Copy link
Author

The link is working, but the postinstall.js script is not. I still get the error above.

@anp anp changed the title Yarn not passing SSL=false to ngrok dep Need to bundle ngrok binary in the npm package, or make it optional Mar 16, 2017
@anp anp closed this as completed in 85a6ae3 Mar 17, 2017
@thebetterjort
Copy link
Author

thebetterjort commented Mar 22, 2017

the fixes still do not fix the SSL certificate error that I get.

yarn start v0.21.3
$ react-native-scripts start 
Starting packager...
Error starting packager: Error: Unable to perform cache refresh for /home/username/.cache/expo/versions.json: Error: self signed certificate in certificate chain
    at /xdl/src/tools/FsCache.js:101:15
    at throw (native)
    at step (/home/username/Documents/my-app/node_modules/xdl/build/tools/FsCache.js:32:191)
    at /home/username/Documents/my-app/node_modules/xdl/build/tools/FsCache.js:32:402
error Command failed with exit code 1.

@anp
Copy link
Contributor

anp commented Mar 22, 2017

We don't have any plans to allow disabling TLS, but you can specify the HTTP_PROXY and HTTPS_PROXY environment variables.

We are planning to provide a cached version of these files by default in the near future, just needs to be implemented.

@thebetterjort
Copy link
Author

export NODE_TLS_REJECT_UNAUTHORIZED=0

fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants