Skip to content

ssl handshake failure v0.12 or v0.11 #4485

Closed
@magicode

Description

@magicode

Test Code

var https = require('https');
//var tls = require("tls");

var url = require("url");

var counter = 0;

function reqHttps(path , callback){
    var parseUrl = url.parse(path);

    counter++;
    if(counter % 1000 == 0) console.log("req:" , counter);

    var options = {};
    options.hostname = parseUrl.hostname;
    options.path = parseUrl.path;
    options.method = 'POST';
    options.secureProtocol = 'TLSv1_method';

    options.agent =  new https.Agent({
        host: options.hostname,
        port: 443,
    });
    var req = https.request(options, function(res) {

        res.on('data', function(d) {

        });

        res.on('end', function(d) {

            callback();
        });
    });

    req.on('error',function(err){
        if((err +'').indexOf('EPROTO') != -1) return callback();
        //if((err +'').indexOf('unable to verify') != -1) return callback();
        console.log('URL: ' + path);
        throw err;
    });

    req.end();

}

var list = [];
list.push('https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_116x41dp.png');
list.push('https://www.flpil.co.il/'); // no support TLSv1_method

var randCounter = 0;


function getUrl(){
    var currId = randCounter++;

    currId = currId % list.length;

    return list[currId];
}


for(var i =0;i<300;i++){
    (function(){
        function next(){
            reqHttps(getUrl(),next);
        }   
        next();
    })();

}

Output in node v0.12 or v.0.11

URL: https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_116x41dp.png
/home/test.js:41
        throw err;
              ^
Error: 140321677469568:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:637:

    at Error (native)

Output in node v0.10 , v4 , v5

req: 1000
req: 2000
req: 3000
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.tlsIssues and PRs related to the tls subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions