{"action":"created","issue":{"url":"https://api.github.com/repos/socketio/socket.io/issues/2265","repository_url":"https://api.github.com/repos/socketio/socket.io","labels_url":"https://api.github.com/repos/socketio/socket.io/issues/2265/labels{/name}","comments_url":"https://api.github.com/repos/socketio/socket.io/issues/2265/comments","events_url":"https://api.github.com/repos/socketio/socket.io/issues/2265/events","html_url":"https://github.com/socketio/socket.io/issues/2265","id":109056831,"number":2265,"title":"Socket.io randomly disconnects with SSL","user":{"login":"thlassche","id":2959888,"avatar_url":"https://avatars.githubusercontent.com/u/2959888?v=3","gravatar_id":"","url":"https://api.github.com/users/thlassche","html_url":"https://github.com/thlassche","followers_url":"https://api.github.com/users/thlassche/followers","following_url":"https://api.github.com/users/thlassche/following{/other_user}","gists_url":"https://api.github.com/users/thlassche/gists{/gist_id}","starred_url":"https://api.github.com/users/thlassche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thlassche/subscriptions","organizations_url":"https://api.github.com/users/thlassche/orgs","repos_url":"https://api.github.com/users/thlassche/repos","events_url":"https://api.github.com/users/thlassche/events{/privacy}","received_events_url":"https://api.github.com/users/thlassche/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-09-30T10:18:03Z","updated_at":"2016-11-21T08:22:00Z","closed_at":null,"body":"I'm having a weird problem with Socket.io and SSL. I'm seeing this in the logs:\n\n```\nsocket.io-parser encoded %j as Object +0ms 2[\"data\",{\"data\":\"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACAWGBwYFCAcGhwkIiAm…CmsTRRQBXkYk06McZoooGTA0uTmiimA7JFNlY4oooAgX7h9zUq/LgCiikBITkCpE9aKKAP/9k=\",\"aspectRatio\":0.75,\"streamId\":\"base\",\"timestamp\":1443536969377}]\nengine.io-client:socket flushing 1 packets in socket +8ms\nengine.io-client:socket socket receive: type \"message\", data \"2[\"data\",{\"data\":\"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACAWGBwYFCAcGhwkIiAm…AKGOKKKBlaRjmnRDvRRQBMDxmnA0UUxDgTTZWOKKKBlZfufU1Mp24AoopASE1JH0zRRQB//9k=\",\"aspectRatio\":0.75,\"streamid\":\"base\"}]\" +20ms\nsocket.io-parser decoded 2[\"data\",{\"data\":\"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACAWGBwYFCAcGhwkIiAm…AKGOKKKBlaRjmnRDvRRQBMDxmnA0UUxDgTTZWOKKKBlZfufU1Mp24AoopASE1JH0zRRQB//9k=\",\"aspectRatio\":0.75,\"streamid\":\"base\"}] as %j +22ms Object {type: 2, nsp: \"/\", data: Array[2]}\nsocket.io-client:socket emitting event %j +27ms [\"data\", Object]\nsocket.io-client:manager writing packet %j +60ms Object {type: 2, data: Array[2], nsp: \"/\"}\nsocket.io-parser encoding packet %j +37ms Object {type: 2, data: Array[2], nsp: \"/\"}\nsocket.io-parser encoded %j as Object +1ms 2[\"data\",{\"data\":\"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDACAWGBwYFCAcGhwkIiAm…YmiigCvIxJp0Y4zRRQBMDS5OaKKYDskU2VjiiigCBfuH3NSr8uAKKKQEhOcVInTNFFAH//2Q==\",\"aspectRatio\":0.75,\"streamId\":\"base\",\"timestamp\":1443536969437}]\nengine.io-client:socket flushing 1 packets in socket +39ms\nengine.io-client:socket socket close with reason: \"transport close\" +32ms\nsocket.io-client:manager close +34ms\nsocket.io-client:socket close (transport close) +71ms\nsocket.io-client:manager will wait 762ms before reconnect attempt +0ms\nsocket.io-client:manager attempting reconnect +764ms\nsocket.io-client:manager readyState closed +0ms\nsocket.io-client:manager opening https://server.tld:4003 +0ms\nengine.io-client:socket creating transport \"polling\" +767ms\nengine.io-client:polling polling +1ms\nengine.io-client:polling-xhr xhr poll +0ms\nengine.io-client:polling-xhr xhr open GET: https://server.tld:4003/socket.io/?EIO=3&transport=polling&t=1443536970238-5 +1ms\nengine.io-client:polling-xhr xhr data null +0ms\nengine.io-client:socket setting transport polling +1ms\nsocket.io-client:manager connect attempt will timeout after 20000 +5ms\n```\n\nAs can be seen, the socket is closed for reason: transport close\n\nThis happens every now and then, with unconsistent intervals (intervals are in the order of seconds (10-60)).\n\nWhy is that caused? There are no errors in the log.\n\nCode to instantiate the server:\n\n```\nvar fs = require( 'fs' );\nvar app = require('express')();\nvar https        = require('https');\nhttps.globalAgent.maxSockets = 20000;\nhttps.globalAgent.keepAlive = true;\nvar server = https.createServer({\n    key: fs.readFileSync('/path/to/key.key'),\n    cert: fs.readFileSync('/path/to/crt/.crt'),\n    ca: fs.readFileSync('/path/to/ca-bundle.crt'),\n    requestCert: false,\n    rejectUnauthorized: false\n},app);\nserver.listen(4003);\n\nvar io = require('socket.io').listen(server);\n```\n\nWhen swapping above code with this (and thus disabling SSL) no problems occur:\n\n```\nvar fs = require('fs');\nvar io = require('socket.io').listen(4002);\n```\n"},"comment":{"url":"https://api.github.com/repos/socketio/socket.io/issues/comments/261872547","html_url":"https://github.com/socketio/socket.io/issues/2265#issuecomment-261872547","issue_url":"https://api.github.com/repos/socketio/socket.io/issues/2265","id":261872547,"user":{"login":"jeetblswami","id":5561469,"avatar_url":"https://avatars.githubusercontent.com/u/5561469?v=3","gravatar_id":"","url":"https://api.github.com/users/jeetblswami","html_url":"https://github.com/jeetblswami","followers_url":"https://api.github.com/users/jeetblswami/followers","following_url":"https://api.github.com/users/jeetblswami/following{/other_user}","gists_url":"https://api.github.com/users/jeetblswami/gists{/gist_id}","starred_url":"https://api.github.com/users/jeetblswami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeetblswami/subscriptions","organizations_url":"https://api.github.com/users/jeetblswami/orgs","repos_url":"https://api.github.com/users/jeetblswami/repos","events_url":"https://api.github.com/users/jeetblswami/events{/privacy}","received_events_url":"https://api.github.com/users/jeetblswami/received_events","type":"User","site_admin":false},"created_at":"2016-11-21T08:22:00Z","updated_at":"2016-11-21T08:22:00Z","body":"I am facing the same Issue on 1.3.5 ."}}
{"actor":{"display_login":"jeetblswami"}}