You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ALPNProtocols option of TLSSocket constructor is broken. #16643
TypeError: Must give a Buffer as first argument
at TLSSocket._init (_tls_wrap.js:516:9)
at new TLSSocket (_tls_wrap.js:304:8)
at repl:1:14
at ContextifyScript.Script.runInThisContext (vm.js:50:33)
at REPLServer.defaultEval (repl.js:240:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:441:10)
at emitOne (events.js:120:20)
at REPLServer.emit (events.js:210:7)
If this is indeed a documentation bug, I'd be happy to open a pull request. I'll take a shot at a code bug if the issue is determined to be there instead.
It sounds like the constructor should call tls.convertALPNProtocols() and tls.convertNPNProtocols() instead of letting tls.connect() and tls.createServer() do that before passing it on to new TLSSocket().
I wasn't aware of these methods, thanks for the tip. I'll probably have to apply them within the TLSSocket constructor though. Do you mean these should be applied before calling the Socket constructor?
@addaleax Hmm. I think I wasn't making myself clear. I mean to call these within the TLSSocket constructor, as you say. I think we're on the same page though. Do you mind if I assign myself? It'll be a nice way to ease myself into the codebase.
Activity
bnoordhuis commentedon Oct 31, 2017
It sounds like the constructor should call
tls.convertALPNProtocols()andtls.convertNPNProtocols()instead of lettingtls.connect()andtls.createServer()do that before passing it on tonew TLSSocket().qubyte commentedon Oct 31, 2017
I wasn't aware of these methods, thanks for the tip. I'll probably have to apply them within the
TLSSocketconstructor though. Do you mean these should be applied before calling theSocketconstructor?addaleax commentedon Oct 31, 2017
@qubyte I think it’s more like, the
TLSSocketconstructor should call them, not userland code.But for now calling them yourself should be fine as a workaround.
qubyte commentedon Oct 31, 2017
@addaleax Hmm. I think I wasn't making myself clear. I mean to call these within the
TLSSocketconstructor, as you say. I think we're on the same page though. Do you mind if I assign myself? It'll be a nice way to ease myself into the codebase.addaleax commentedon Oct 31, 2017
@qubyte Yes, I think we’re on the same page. Go for it if you like!
qubyte commentedon Oct 31, 2017
Thanks! Looks like I can't self-assign though. Would you mind doing that for me please?
tls: accept array of protocols in TLSSocket
apapirovski commentedon Nov 4, 2017
Fixed by 291ff72