This repository has been archived by the owner. It is now read-only.

HTTPS fails with 'socket hang up' #939

Closed
lexer opened this Issue Apr 15, 2011 · 6 comments

Comments

Projects
None yet
5 participants
@lexer

lexer commented Apr 15, 2011

I'm developing nodejs oauth2 npm module: https://github.com/lexer/node-oauth2

When Im trying to make https request to google or facebook i get:

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: socket hang up
    at Socket.<anonymous> (http.js:1272:45)
    at Socket.emit (events.js:64:17)
    at Array.<anonymous> (net.js:825:12)
    at EventEmitter._tickCallback (node.js:126:26)

You can reproduce bug in express sample application that i've made:

https://github.com/lexer/node-oauth2/tree/master/examples/express

@lexer

This comment has been minimized.

Show comment
Hide comment
@lexer

lexer Apr 17, 2011

Have fixed the issue. Instead of http.ClientRequest with secure option "true" im using https.request method that works fine.

lexer commented Apr 17, 2011

Have fixed the issue. Instead of http.ClientRequest with secure option "true" im using https.request method that works fine.

@johnae

This comment has been minimized.

Show comment
Hide comment
@johnae

johnae Apr 25, 2011

This issue looks like the same as the one I reported here nodejitsu/node-http-proxy#36

johnae commented Apr 25, 2011

This issue looks like the same as the one I reported here nodejitsu/node-http-proxy#36

@elektrowolf

This comment has been minimized.

Show comment
Hide comment
@elektrowolf

elektrowolf Apr 3, 2012

Getting the same error on 0.6.14, using either https.get, https.request or the request library:

Error: socket hang up
    at createHangUpError (http.js:1107:15)
    at CleartextStream.<anonymous> (http.js:1210:27)
    at CleartextStream.emit (events.js:88:20)
    at Array.0 (tls.js:792:22)
    at EventEmitter._tickCallback (node.js:192:40)

The same code, however, is working when deployed to the production environment on Nodester which is running 0.6.12.

elektrowolf commented Apr 3, 2012

Getting the same error on 0.6.14, using either https.get, https.request or the request library:

Error: socket hang up
    at createHangUpError (http.js:1107:15)
    at CleartextStream.<anonymous> (http.js:1210:27)
    at CleartextStream.emit (events.js:88:20)
    at Array.0 (tls.js:792:22)
    at EventEmitter._tickCallback (node.js:192:40)

The same code, however, is working when deployed to the production environment on Nodester which is running 0.6.12.

@xdmx

This comment has been minimized.

Show comment
Hide comment
@xdmx

xdmx Aug 13, 2012

I confirm this problem (0.8.6).
If you try:

var req = require('https').request({host:'wepay.com', port:443, path:'/', method:'HEAD', agent:false}, function (res) {console.log("done " + res.headers['server']);}); req.end();

It won't return anything (I've tried from 2 different places/connections)

But
var req = require('https').request({host:'stripe.com', port:443, path:'/', method:'HEAD', agent:false}, function (res) {console.log("done " + res.headers['server']);}); req.end();

(as many other websites) works correctly

I've found several hostnames that have this problem

xdmx commented Aug 13, 2012

I confirm this problem (0.8.6).
If you try:

var req = require('https').request({host:'wepay.com', port:443, path:'/', method:'HEAD', agent:false}, function (res) {console.log("done " + res.headers['server']);}); req.end();

It won't return anything (I've tried from 2 different places/connections)

But
var req = require('https').request({host:'stripe.com', port:443, path:'/', method:'HEAD', agent:false}, function (res) {console.log("done " + res.headers['server']);}); req.end();

(as many other websites) works correctly

I've found several hostnames that have this problem

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Aug 13, 2012

Member

@xdmx It's not the same bug but it is a bug. Can you open a new issue?

I'm closing this one, the hangup errors have been fixed a long time ago.

Member

bnoordhuis commented Aug 13, 2012

@xdmx It's not the same bug but it is a bug. Can you open a new issue?

I'm closing this one, the hangup errors have been fixed a long time ago.

@bnoordhuis bnoordhuis closed this Aug 13, 2012

@xdmx

This comment has been minimized.

Show comment
Hide comment
@xdmx

xdmx Aug 13, 2012

sure, here it is #3865

xdmx commented Aug 13, 2012

sure, here it is #3865

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.