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

    1. var options = {
    2. host: 'badssl.com',
    3. port: 443,
    4. path: '/',
    5. method: 'GET',
    6. protocol: 'https:',
    7. };

    and this code after the definition.

    1. var req = require("http").request(options, function(res) {
    2. res.on('data', function(data) {
    3. console.log(res);
    4. console.log("HTTP> "+data);
    5. });
    6. res.on('close', function(data) {
    7. console.log(res);
    8. console.log("Connection closed");
    9. });
    10. });

    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