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

SSL/TLS related socket errors #522

Closed
jasonwebster opened this issue Sep 13, 2011 · 7 comments
Closed

SSL/TLS related socket errors #522

jasonwebster opened this issue Sep 13, 2011 · 7 comments

Comments

@jasonwebster
Copy link

Over the last couple days, we've been experiencing consistent errors in server <-> client communication. I'm not familiar enough with the intricacies of how the SSL handshake process works over websockets to be able to tell exactly what's going on here, but here's the two errors I often see caught by socket.io:

  info  - socket error Error: error:00000001:lib(0):func(0):reason(1)
    at CleartextStream._pusher (tls.js:416:24)
    at CleartextStream._push (tls.js:262:25)
    at SecurePair.cycle (tls.js:577:20)
    at EncryptedStream.write (tls.js:96:13)
    at Socket.ondata (stream.js:36:26)
    at Socket.emit (events.js:64:17)
    at Socket._onReadable (net.js:678:14)
    at IOWatcher.onReadable [as callback] (net.js:177:10)


   info  - socket error Error: error:00000001:lib(0):func(0):reason(1)
    at CleartextStream._pusher (tls.js:416:24)
    at CleartextStream._push (tls.js:262:25)
    at SecurePair.cycle (tls.js:577:20)
    at CleartextStream.write (tls.js:96:13)
    at WebSocket.write (/home/jason/flow-socket-server/vendor/socket.io-node/lib/transports/websocket/default.js:184:23)
    at WebSocket.packet (/home/jason/flow-socket-server/vendor/socket.io-node/lib/transport.js:515:15)
    at WebSocket.heartbeat (/home/jason/flow-socket-server/vendor/socket.io-node/lib/transport.js:330:10)
    at Object._onTimeout (/home/jason/flow-socket-server/vendor/socket.io-node/lib/transport.js:301:12)
    at Timer.callback (timers.js:83:39)


I may be wrong, but it seems like these almost always happen after the server tries to write down the connection to the client.

Environment details:

Ubuntu hardy 8.04 LTS (with sec updates)

Socket.io 0.8.4 (typically use a forked version [no changes at this point] of the repo as a submodule of the project, however I did try using the npm version with the exact same results.)

$ node -v v0.4.11

$ openssl version OpenSSL 0.9.8g 19 Oct 2007

If there's any other details that would be helpful, please let me know.

@koichik
Copy link

koichik commented Sep 13, 2011

info - socket error Error: error:00000001:lib(0):func(0):reason(1)

Because Node does not handle an error from OpenSSL correctly, this message is not helpful.
Can you try with this patch (koichik/node@7326444, for node v0.4 branch)?

@jasonwebster
Copy link
Author

Applied the patch to node, error is:

socket error Error: error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request

@jasonwebster
Copy link
Author

I should note that I've tried reverting to older versions of node, as well as socket.io with no difference.

Additionally, there was no change (that we're aware of) in our platform before this started. I've also verified all our certs, and there's nothing funny going on there.

@jasonwebster
Copy link
Author

So, from what I understand of that error message, the client is making a plain HTTP request when it should be making an HTTPS request. I can confirm (via inspector) that the socket.io client correctly has the secure option set, and that the websocket connection is established using the wss protocol in the url.

@koichik
Copy link

koichik commented Sep 16, 2011

It may be related to nodejs/node-v0.x-archive#1719.
It was fixed in node v0.4.12. Can you try it?

@3rd-Eden
Copy link
Contributor

Closing this as it's not something that Socket.IO can fix. (if it is, give me a poke and i'll re-open <3)

@jasonwebster
Copy link
Author

Agreed. It wasn't a socket.io issue.

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

No branches or pull requests

3 participants