Skip to content
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

Write EPROTO error on Node 8 and above #19359

Closed
dogancelik opened this issue Mar 14, 2018 · 11 comments
Closed

Write EPROTO error on Node 8 and above #19359

dogancelik opened this issue Mar 14, 2018 · 11 comments
Labels
confirmed-bug Issues with confirmed bugs. duplicate Issues and PRs that are duplicates of other issues or PRs. regression Issues related to regressions. tls Issues and PRs related to the tls subsystem.

Comments

@dogancelik
Copy link

I'm getting EPROTO errors on Node 8 and above

Test code test.js

var https = require('https');
var fs = require('fs');

console.log('Node', process.version);

var writeStream = fs.createWriteStream('test.html');
writeStream.on('finish', function () {
  console.log('Finish');
})

https.get('https://handbrake.fr/nightly.php', function (res) {
  res.pipe(writeStream);
});

Test by version

v4

$ node test.js
Node v4.8.7
Finish

v5

$ node test.js
Node v5.12.0
Finish

v6

$ node test.js
Node v6.13.1
Finish

v7

$ node test.js
Node v7.10.1
Finish

v8

$ node test.js
Node v8.10.0
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: write EPROTO 101057795:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:openssl\ssl\s23_clnt.c:802:

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

v9

$ node test.js
Node v9.8.0
events.js:165
      throw er; // Unhandled 'error' event
      ^

Error: write EPROTO 101057795:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:openssl\ssl\s23_clnt.c:802:

    at WriteWrap.afterWrite [as oncomplete] (net.js:841:14)
Emitted 'error' event at:
    at TLSSocket.socketErrorListener (_http_client.js:394:9)
    at TLSSocket.emit (events.js:180:13)
    at onwriteError (_stream_writable.js:427:12)
    at onwrite (_stream_writable.js:449:5)
    at _destroy (internal/streams/destroy.js:39:7)
    at TLSSocket.Socket._destroy (net.js:545:3)
    at TLSSocket.destroy (internal/streams/destroy.js:32:8)
    at WriteWrap.afterWrite [as oncomplete] (net.js:843:10)

Version: 4-9 (arch. 64-bit) (listed in console log above)
Platform: Windows 10 (64-bit)

@dogancelik
Copy link
Author

Note: handbrake.fr has A+ grade SSL (ref)

ssl

@addaleax
Copy link
Member

Looks like this was introduced somewhere between v8.5.0 and v8.6.0.

Also, this doesn’t appear to reproduce on master for me?

@addaleax addaleax added the tls Issues and PRs related to the tls subsystem. label Mar 14, 2018
@dogancelik
Copy link
Author

@addaleax Yeah it works in v10

$ node-nightly test.js
Node v10.0.0-nightly20180314040dd244de
Finish

@mscdex
Copy link
Contributor

mscdex commented Mar 14, 2018

git bisect points to: #15206

/cc @rogaps @jasnell @bnoordhuis @tniessen

@mscdex mscdex added confirmed-bug Issues with confirmed bugs. regression Issues related to regressions. labels Mar 14, 2018
@addaleax
Copy link
Member

And reverse git bisect says that the fix for this on master is af78840 (#16853), which was labelled semver-major.

I am not sure in what way that is actually a breaking change.

@jasnell
Copy link
Member

jasnell commented Mar 14, 2018 via email

@rogaps
Copy link
Contributor

rogaps commented Mar 15, 2018

This happens because of mismatched ecdhCurves. Before the fix, node uses prime256v1 as default. This is the related issue #16196

@bnoordhuis
Copy link
Member

I'll close this out because it's essentially a duplicate of #16196 but thank you for writing up a good bug report. If anyone has ideas on what direction to take, please chime in on that issue.

@bnoordhuis bnoordhuis added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Mar 19, 2018
@harishmahajan
Copy link

I try this.

NODE_TLS_REJECT_UNAUTHORIZED=0 yarn install

and my issue is solved.

@bnoordhuis
Copy link
Member

No, you just swapped one issue for another. NODE_TLS_REJECT_UNAUTHORIZED=0 turns off TLS certificate validation; it's no better than unencrypted HTTP in terms of security.

hugo19941994 added a commit to hugo19941994/jwks-fetch that referenced this issue Dec 13, 2018
@bastianhilton
Copy link

If anyone is having this issue in Gridsome just FYI that it probably has something to do with your gridsome.server.js file.

Default file should look something like this:

// Server API makes it possible to hook into various parts of Gridsome
// on server-side and add custom data to the GraphQL data layer.
// Learn more: https://gridsome.org/docs/server-api/

// Changes here require a server restart.
// To restart press CTRL + C in terminal and run gridsome develop

module.exports = function (api) {
api.loadSource(({ addCollection }) => {
// Use the Data Store API here: https://gridsome.org/docs/data-store-api/
})

api.createPages(({ createPage }) => {
// Use the Pages API here: https://gridsome.org/docs/pages-api/
})
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. duplicate Issues and PRs that are duplicates of other issues or PRs. regression Issues related to regressions. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

No branches or pull requests

8 participants