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 }}
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.
The reason for this is due to this code in stomp.js
stomp.socket=tls.connect(stomp.port,stomp.host,stomp.ssl_options,function(){log.debug('SSL connection complete');if(!stomp.socket.authorized){log.error('SSL is not authorized: '+stomp.socket.authorizationError);if(stomp.ssl_validate){_disconnect(stomp);return;}}_setupListeners(stomp);});
_setupListeners(stomp); is only called after tls.connect() succeeds, in the callback.
I've been on vacation, but I'm starting to get back into the swing of things. I'll look into refactoring this code, and hopefully addressing this in a nicer way, as soon as possible.
Thanks for your report, and if you'd like to take a stab at cleaning this up, feel free!
The following code will cause node to terminate on a TLS authentication error:
I had to add the following (immediately after
connect()
) to be able to catch it:The reason for this is due to this code in
stomp.js
_setupListeners(stomp);
is only called aftertls.connect()
succeeds, in the callback.According to http://nodejs.org/api/tls.html#tls_tls_connect_port_host_options_callback
Since there is no
socket.on('error')
handler when tls.connect fails, stomp never catches the error and never, subsequently, emits its own error.I did find the above workaround, but it seems that
stomp.on('error')
should have worked the first time.The text was updated successfully, but these errors were encountered: