LeonardLaszlo / nw.js-armv7-binaries

NW.js ARMv7 and ARMv8 binaries and the scripts for building and running the executable.
145 stars 22 forks source link

OpenSSL issue #7

Closed LeonardLaszlo closed 6 years ago

LeonardLaszlo commented 7 years ago

There is a problem with the OpenSSL in ARMv7 builds. When I run something like:

var request = require('request');

request('https://www.google.com', function (error, response, body) {
  console.log('error:', error); // Print the error if one occurred
  console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
  console.log('body:', body); // Print the HTML for the Google homepage.
});

I get the following error:

error: Error: write EPROTO 2970357760:error:1006706B:elliptic curve routines:ec_GFp_simple_oct2point:point is not on curve:../../third_party/node/deps/openssl/openssl/crypto/ec/ecp_oct.c:417:
2970357760:error:1408D132:SSL routines:ssl3_get_key_exchange:bad ecpoint:../../third_party/node/deps/openssl/openssl/ssl/s3_clnt.c:1875:

    at exports._errnoException (util.js:1022:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:804:14)

@jtg-gg Any idea what is wrong?

jtg-gg commented 7 years ago

@LeonardLaszlo I am not sure, FYI this arm build was experimental, we are not using this yet in our daily build, so I can't help you to debug run time error :(

LeonardLaszlo commented 7 years ago

Here I've found some additional information about the problem:

https://github.com/Microsoft/openssl/commit/68886be7e2cd395a759fcd41d2cede461b68843d https://trac.macports.org/ticket/38015?cversion=0&cnum_hist=10

EDIT:

I checked the problematic file https://github.com/nwjs/node/blob/nw23/deps/openssl/openssl/crypto/ec/ecp_oct.c

The invocation of EC_POINT_is_on_curve(group, point, ctx) <= 0 seems correct. However the OpenSSL library of the Node fork used for NW.JS seems not to be updated in the last 8 moths.

I suggest to update the version of Node / OpenSSL to the latest version.

gizmopt commented 7 years ago

Hello @LeonardLaszlo I experiencing this problem too, I tried different versions and have always the same issue. I tried to use the version 22 but it gives-me an error like you reference on the issue https://github.com/LeonardLaszlo/nw.js-armv7-binaries/issues/9

With this ported version https://github.com/jalbam/nwjs_rpi I don't have this problem but have others due to the old version its on it.

Any ideas? I really need to use nw with an Rpi3 Thank's.

LeonardLaszlo commented 7 years ago

Well we need some enthuziast developer, who is able to debug Chromium and it's dependencies. Unfortunately I cannot help with that...

jtg-gg commented 7 years ago

@LeonardLaszlo I've "fixed" the openssl issue, by disabling openssl assembly files I am currently testing it on nw24 beta, will patch nw23 later, I'll update you once I am done

LeonardLaszlo commented 7 years ago

thank you!

jtg-gg commented 7 years ago

Apply these 3 patches on top of original nwjs/chromium.src repository screen shot 2017-07-07 at 11 46 12 am

Apply these 3 patches on top of original nwjs/nw.js repository screen shot 2017-07-07 at 11 47 54 am

if you curious, this is the actual node.js openssl patch that "fix" the https connection problem https://github.com/jtg-gg/node-webkit/commit/27537f1b8563b805eec1b3e327296a824cdd5f79#diff-63fcc6b9d8ae5bba928e573d8340e3c3

LeonardLaszlo commented 6 years ago

Fixed with release: NW.js ARMv7 v0.24.5