{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/3692","labels_url":"https://api.github.com/repos/nodejs/node/issues/3692/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/3692/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/3692/events","html_url":"https://github.com/nodejs/node/issues/3692","id":115533607,"number":3692,"title":"HTTP/HTTPS client requests throwing EPROTO","user":{"login":"brandonros","id":8949910,"avatar_url":"https://avatars.githubusercontent.com/u/8949910?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonros","html_url":"https://github.com/brandonros","followers_url":"https://api.github.com/users/brandonros/followers","following_url":"https://api.github.com/users/brandonros/following{/other_user}","gists_url":"https://api.github.com/users/brandonros/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonros/subscriptions","organizations_url":"https://api.github.com/users/brandonros/orgs","repos_url":"https://api.github.com/users/brandonros/repos","events_url":"https://api.github.com/users/brandonros/events{/privacy}","received_events_url":"https://api.github.com/users/brandonros/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/http","name":"http","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":84,"created_at":"2015-11-06T16:05:41Z","updated_at":"2016-01-30T18:32:09Z","closed_at":null,"body":"```\r\nError: write EPROTO\r\n    at Object.exports._errnoException (util.js:874:11)\r\n    at exports._exceptionWithHostPort (util.js:897:20)\r\n    at WriteWrap.afterWrite (net.js:763:14)\r\n```\r\n\r\nMy code is littered with both HTTP and HTTPS requests. I have no idea what is causing this error but it is occurring in many places since I've upgraded to 4.2.1 from 0.12.7. Please tell me what information I need to provide to help debug this."},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/177268277","html_url":"https://github.com/nodejs/node/issues/3692#issuecomment-177268277","issue_url":"https://api.github.com/repos/nodejs/node/issues/3692","id":177268277,"user":{"login":"tristanls","id":730640,"avatar_url":"https://avatars.githubusercontent.com/u/730640?v=3","gravatar_id":"","url":"https://api.github.com/users/tristanls","html_url":"https://github.com/tristanls","followers_url":"https://api.github.com/users/tristanls/followers","following_url":"https://api.github.com/users/tristanls/following{/other_user}","gists_url":"https://api.github.com/users/tristanls/gists{/gist_id}","starred_url":"https://api.github.com/users/tristanls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tristanls/subscriptions","organizations_url":"https://api.github.com/users/tristanls/orgs","repos_url":"https://api.github.com/users/tristanls/repos","events_url":"https://api.github.com/users/tristanls/events{/privacy}","received_events_url":"https://api.github.com/users/tristanls/received_events","type":"User","site_admin":false},"created_at":"2016-01-30T18:32:09Z","updated_at":"2016-01-30T18:32:09Z","body":"I set `secureProtocol` option to a method that is not supposed to be supported by DynamoDB `TLSv1_1_method`:\r\n```\r\n[root@920c620688d9 /]# vi test.sh \r\n\r\n#!/bin/bash\r\nNODE_DEBUG=net,tls node -e '\r\n    var c = require(\"tls\").connect(\r\n    {\r\n        host:\"dynamodb.us-east-1.amazonaws.com\",\r\n        port:443,\r\n        rejectUnauthorized: true,\r\n        secureProtocol: \"TLSv1_1_method\"\r\n    });\r\n    c.pipe(process.stdout);\r\n    c.write(\"GET / HTTP/1.1\\r\\nHost: dynamodb.us-east-1.amazonaws.com\\r\\n\\r\\n\");\r\n'\r\n```\r\nWhat was surprising is that it \"worked\"?? twice?\r\n```\r\n[root@920c620688d9 /]# ./test.sh \r\nNET 584: pipe false undefined\r\nNET 584: connect: find host dynamodb.us-east-1.amazonaws.com\r\nNET 584: connect: dns options { family: undefined, hints: 40 }\r\nNET 584: _read\r\nNET 584: _read wait for connection\r\nNET 584: afterConnect\r\nTLS 584: start\r\nNET 584: _read\r\nNET 584: Socket._read readStart\r\nTLS 584: secure established\r\nNET 584: afterWrite 0\r\nNET 584: afterWrite call cb\r\nNET 584: onread 255\r\nNET 584: got data\r\nHTTP/1.1 200 OK\r\nServer: Server\r\nDate: Sat, 30 Jan 2016 18:29:48 GMT\r\nContent-Length: 42\r\nConnection: keep-alive\r\nx-amzn-RequestId: 4IIH8II2DIOA2V3KS7163570ARVV4KQNSO5AEMVJF66Q9ASUAAJG\r\nx-amz-crc32: 3128867991\r\n\r\nhealthy: dynamodb.us-east-1.amazonaws.com NET 584: _read\r\n^C\r\n[root@920c620688d9 /]# ./test.sh \r\nNET 594: pipe false undefined\r\nNET 594: connect: find host dynamodb.us-east-1.amazonaws.com\r\nNET 594: connect: dns options { family: undefined, hints: 40 }\r\nNET 594: _read\r\nNET 594: _read wait for connection\r\nNET 594: afterConnect\r\nTLS 594: start\r\nNET 594: _read\r\nNET 594: Socket._read readStart\r\nTLS 594: secure established\r\nNET 594: afterWrite 0\r\nNET 594: afterWrite call cb\r\nNET 594: onread 255\r\nNET 594: got data\r\nHTTP/1.1 200 OK\r\nServer: Server\r\nDate: Sat, 30 Jan 2016 18:29:50 GMT\r\nContent-Length: 42\r\nConnection: keep-alive\r\nx-amzn-RequestId: C7G7PAHI3UR674G0B5LC3LHH6BVV4KQNSO5AEMVJF66Q9ASUAAJG\r\nx-amz-crc32: 3128867991\r\n\r\nhealthy: dynamodb.us-east-1.amazonaws.com NET 594: _read\r\n^C\r\n[root@920c620688d9 /]# ./test.sh \r\nNET 604: pipe false undefined\r\nNET 604: connect: find host dynamodb.us-east-1.amazonaws.com\r\nNET 604: connect: dns options { family: undefined, hints: 40 }\r\nNET 604: _read\r\nNET 604: _read wait for connection\r\nNET 604: afterConnect\r\nTLS 604: start\r\nNET 604: _read\r\nNET 604: Socket._read readStart\r\n{\"type\":\"log\",\"level\":\"debug\",\"target\":\"ssl3_get_record\",\"recv\":\"301\",\"s.v\":\"302\",\"s.ref\":\"1\"}\r\n{\"type\":\"log\",\"level\":\"debug\",\"target\":\"ssl3_get_record\",\"contents\":\"16, 03, 01, 0a, 94, \"}\r\nNET 604: afterWrite -71\r\nNET 604: write failure { Error: write EPROTO 139766103729984:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:../deps/openssl/openssl/ssl/s3_pkt.c:362:\r\n\r\n    at exports._errnoException (util.js:859:11)\r\n    at WriteWrap.afterWrite (net.js:763:14) code: 'EPROTO', errno: 'EPROTO', syscall: 'write' }\r\nNET 604: destroy\r\nNET 604: close\r\nNET 604: close handle\r\nevents.js:155\r\n      throw er; // Unhandled 'error' event\r\n      ^\r\n\r\nError: write EPROTO 139766103729984:error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number:../deps/openssl/openssl/ssl/s3_pkt.c:362:\r\n\r\n    at exports._errnoException (util.js:859:11)\r\n    at WriteWrap.afterWrite (net.js:763:14)\r\n```"}}