This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Allow tls.connect to start on server-side sockets and add tls.start as a simple wrapper for tls.connect #3653
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1119,7 +1119,8 @@ exports.connect = function(/* [port, host], options, cb */) { | |||
var sslcontext = crypto.createCredentials(options); | |||
|
|||
convertNPNProtocols(options.NPNProtocols, this); | |||
var pair = new SecurePair(sslcontext, false, true, | |||
|
|||
var pair = new SecurePair(sslcontext, options.asServer?true:false, true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style.
Can one of the admins verify this patch? |
This should be implemented in the current unstable, thanks! |
richardlau
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Dec 15, 2015
Fix node exiting due to an exception being thrown rather than emitting an `'uncaughtException'` event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an `'uncaughtException'` event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and `--abort-on-uncaught-exception` is used. Finally, change the behavior of --abort-on-uncaught-exception so that, if the domain within which the error is thrown has no error handler, but a domain further up the domains stack has one, the process will not abort. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3654 PR-URL: nodejs/node#3654 Reviewed-By: Chris Dickinson <chris@neversaw.us>
richardlau
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Dec 17, 2015
Fix node exiting due to an exception being thrown rather than emitting an 'uncaughtException' event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an 'uncaughtException' event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and --abort-on-uncaught-exception is used. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3887 PR-URL: nodejs/node#3887 Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Dec 17, 2015
Fix node exiting due to an exception being thrown rather than emitting an 'uncaughtException' event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an 'uncaughtException' event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and --abort-on-uncaught-exception is used. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3885 PR-URL: nodejs/node#3885 Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Dec 17, 2015
Fix node exiting due to an exception being thrown rather than emitting an `'uncaughtException'` event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an `'uncaughtException'` event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and `--abort-on-uncaught-exception` is used. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3884 PR-URL: nodejs/node#3884 Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Dec 18, 2015
Fix node exiting due to an exception being thrown rather than emitting an `'uncaughtException'` event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an `'uncaughtException'` event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and `--abort-on-uncaught-exception` is used. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3884 PR-URL: nodejs/node#3884 Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Jan 11, 2016
Fix node exiting due to an exception being thrown rather than emitting an `'uncaughtException'` event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an `'uncaughtException'` event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and `--abort-on-uncaught-exception` is used. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3884 PR-URL: nodejs/node#3884 Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Jan 13, 2016
Fix node exiting due to an exception being thrown rather than emitting an `'uncaughtException'` event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an `'uncaughtException'` event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and `--abort-on-uncaught-exception` is used. Finally, change the behavior of --abort-on-uncaught-exception so that, if the domain within which the error is thrown has no error handler, but a domain further up the domains stack has one, the process will not abort. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3654 PR-URL: nodejs/node#3654 Reviewed-By: Chris Dickinson <chris@neversaw.us>
richardlau
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Feb 15, 2016
Fix node exiting due to an exception being thrown rather than emitting an 'uncaughtException' event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an 'uncaughtException' event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and --abort-on-uncaught-exception is used. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3885 PR-URL: nodejs/node#3885 Reviewed-By: James M Snell <jasnell@gmail.com>
richardlau
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Feb 15, 2016
Fix node exiting due to an exception being thrown rather than emitting an 'uncaughtException' event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an 'uncaughtException' event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and --abort-on-uncaught-exception is used. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3887 PR-URL: nodejs/node#3887 Reviewed-By: James M Snell <jasnell@gmail.com>
jBarz
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Nov 4, 2016
Fix node exiting due to an exception being thrown rather than emitting an 'uncaughtException' event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an 'uncaughtException' event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and --abort-on-uncaught-exception is used. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3885 PR-URL: nodejs/node#3885 Reviewed-By: James M Snell <jasnell@gmail.com>
jBarz
pushed a commit
to ibmruntimes/node
that referenced
this pull request
Feb 16, 2017
Fix node exiting due to an exception being thrown rather than emitting an 'uncaughtException' event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an 'uncaughtException' event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and --abort-on-uncaught-exception is used. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3885 PR-URL: nodejs/node#3885 Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have found a piece of code floating on the internet to initiate a TLS function in the middle of a TCP connection, but the code in question has not functioned well. I decided to look into tls.js module whether it can do it all with some minor adjustment.
There was a previous pull request for this function #848
However, current state of connect does not allow to start TLS arbitralily on a server-side socket.
Thus, I propose a very simple change to
tls.connect
allowing to say whether we want a server side socket viaoptions.asServer
but also I add a very nice intuitive wrapper called tls.start and two tests.tls.start
is in the same style aschild_process.fork
so I think it fits together inside node.I am willing to update documention if a green light is given to this improvements.