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

Stop stale errors from popping up causing spurious failures when reusing a kept-alive HTTPS connection #73

Closed
wants to merge 1 commit into from

Conversation

pmq20
Copy link

@pmq20 pmq20 commented Jul 29, 2015

Problem

Stale OpenSSL errors are thrown causing spurious failures when reusing a kept-alive HTTPS connection. A test has been added to reproduce this bug.

  • bad_sign() would inject an error into OpenSSL's error stack
  • Second time of calling requestThunk would make the error be thrown

Solution

As a workaround, forcibly clear OpenSSL's error stack. This workaround could be removed when / if the upstream Node.js / io.js project has fixed this bug.

@pmq20 pmq20 changed the title Fix openssl errors Stop stale errors from popping up when reusing an kept-alive HTTPS connection causing spurious failures Jul 29, 2015
@pmq20 pmq20 changed the title Stop stale errors from popping up when reusing an kept-alive HTTPS connection causing spurious failures Stop stale errors from popping up causing spurious failures when reusing an kept-alive HTTPS connection Jul 29, 2015
@pmq20 pmq20 changed the title Stop stale errors from popping up causing spurious failures when reusing an kept-alive HTTPS connection Stop stale errors from popping up causing spurious failures when reusing a kept-alive HTTPS connection Jul 29, 2015
@coolme200
Copy link

这个可以先不合,等看看能否在 iojs 层面处理。

@pmq20 pmq20 force-pushed the fix-openssl-errors branch from a2aacd1 to c5c51a1 Compare July 29, 2015 09:13
@@ -185,6 +197,7 @@ exports.requestWithCallback = function (url, args, callback) {
var agent = args.agent || exports.agent;

if (parsedUrl.protocol === 'https:') {
workaround_clear_openssl_errors();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add a optional to detect clean openssl errors.

@pmq20
Copy link
Author

pmq20 commented Aug 10, 2015

iojs 层面处理尝试:

nodejs/node#2342

@pmq20 pmq20 force-pushed the fix-openssl-errors branch from c5c51a1 to b2ab4b5 Compare August 10, 2015 12:52
* Add a test for the bug of unwanted openSSL errors
* bad_sign() would inject an error into OpenSSL's error stack
* Second time of calling requestThunk would make the error be thrown
* This stops stale errors from popping up later causing spurious failures
* FIXME: remove me when upstream Node.js has fixed this bug
@pmq20 pmq20 force-pushed the fix-openssl-errors branch from b2ab4b5 to cd54e36 Compare August 18, 2015 02:45
@pmq20
Copy link
Author

pmq20 commented Aug 18, 2015

iojs 层面上的补丁落地了

@dead-horse
Copy link
Member

👍

@fengmk2
Copy link
Member

fengmk2 commented Aug 18, 2015

这个就不合并了。

@fengmk2 fengmk2 closed this Aug 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants