You are reading a single comment by @mkniskanen and its replies. Click here to read the full conversation.
  • In my test script I have these options

    var options = {
          host:   'badssl.com', 
          port:   443,    
          path:   '/',   
          method: 'GET', 
          protocol: 'https:',
        };
    

    and this code after the definition.

    var req = require("http").request(options, function(res) {
        res.on('data', function(data) {
          console.log(res);
          console.log("HTTP> "+data);
        });
        res.on('close', function(data) {
          console.log(res);
          console.log("Connection closed");
        });
      });
    

    However, I keep getting a code 400 reply "The plain HTTP request was sent to HTTPS port". There are no redirects at the server end and I have tested the same functionality with my own server, address http://www.xdb.fi/dummy.txt - with the same result.

    The script seems to be using http, despite all my attempts to switch to https. Do I have two blind eyes? I have one semi-blind already :)

    Markku

About

Avatar for mkniskanen @mkniskanen started