Node HTTPS request failure through proxy server












0















I have valid ssl certificate pem file.



openssl rsa -in cert.pem -passin "pass:password"
writing RSA key

-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAwqsU4MqkLOhm6xoueHu6x4U0zBBgcY+dQra3xD2ZJTXtvxDQ
...
...
...
jKV7oDM0gfEF1bq0OQD0uTaNDvLXWBFaBKx5yxahr1+LL6H1r5wK6Q==
-----END RSA PRIVATE KEY-----


I'm using valid proxy server, which works fine in my browser and uses standard http protocol.



now when I'm running my node.js code.



var fs = require('fs');
var request = require('request');

const data = JSON.stringify({
"compression": "lz4", "replay" : false
});
var proxyServer = 'http://webproxy.e.corp.services:80';

var option = {
proxy: proxyServer,
method: 'POST',
url: 'https://10.51.13.6:8301/request/stream',
json: data,
ca: fs.readFileSync('/]path to]/cert.pem'),
passphrase: 'password',
headers: {
'Host': 'rests_client.xxx.xxxx.com'
}
}

request(option,function (error, response, body) {
if (error) {
return console.error('upload failed:', error);
}
console.log('Upload successful! Server responded with:', body);
});


I'm getting the following error:



upload failed: { Error: write EPROTO 4552209856:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1498:SSL alert number 40
4552209856:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:659:

at WriteWrap.afterWrite [as oncomplete] (net.js:868:14) errno: 'EPROTO', code: 'EPROTO', syscall: 'write' }


I really can't understand what am I missing.










share|improve this question





























    0















    I have valid ssl certificate pem file.



    openssl rsa -in cert.pem -passin "pass:password"
    writing RSA key

    -----BEGIN RSA PRIVATE KEY-----
    MIIEpAIBAAKCAQEAwqsU4MqkLOhm6xoueHu6x4U0zBBgcY+dQra3xD2ZJTXtvxDQ
    ...
    ...
    ...
    jKV7oDM0gfEF1bq0OQD0uTaNDvLXWBFaBKx5yxahr1+LL6H1r5wK6Q==
    -----END RSA PRIVATE KEY-----


    I'm using valid proxy server, which works fine in my browser and uses standard http protocol.



    now when I'm running my node.js code.



    var fs = require('fs');
    var request = require('request');

    const data = JSON.stringify({
    "compression": "lz4", "replay" : false
    });
    var proxyServer = 'http://webproxy.e.corp.services:80';

    var option = {
    proxy: proxyServer,
    method: 'POST',
    url: 'https://10.51.13.6:8301/request/stream',
    json: data,
    ca: fs.readFileSync('/]path to]/cert.pem'),
    passphrase: 'password',
    headers: {
    'Host': 'rests_client.xxx.xxxx.com'
    }
    }

    request(option,function (error, response, body) {
    if (error) {
    return console.error('upload failed:', error);
    }
    console.log('Upload successful! Server responded with:', body);
    });


    I'm getting the following error:



    upload failed: { Error: write EPROTO 4552209856:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1498:SSL alert number 40
    4552209856:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:659:

    at WriteWrap.afterWrite [as oncomplete] (net.js:868:14) errno: 'EPROTO', code: 'EPROTO', syscall: 'write' }


    I really can't understand what am I missing.










    share|improve this question



























      0












      0








      0








      I have valid ssl certificate pem file.



      openssl rsa -in cert.pem -passin "pass:password"
      writing RSA key

      -----BEGIN RSA PRIVATE KEY-----
      MIIEpAIBAAKCAQEAwqsU4MqkLOhm6xoueHu6x4U0zBBgcY+dQra3xD2ZJTXtvxDQ
      ...
      ...
      ...
      jKV7oDM0gfEF1bq0OQD0uTaNDvLXWBFaBKx5yxahr1+LL6H1r5wK6Q==
      -----END RSA PRIVATE KEY-----


      I'm using valid proxy server, which works fine in my browser and uses standard http protocol.



      now when I'm running my node.js code.



      var fs = require('fs');
      var request = require('request');

      const data = JSON.stringify({
      "compression": "lz4", "replay" : false
      });
      var proxyServer = 'http://webproxy.e.corp.services:80';

      var option = {
      proxy: proxyServer,
      method: 'POST',
      url: 'https://10.51.13.6:8301/request/stream',
      json: data,
      ca: fs.readFileSync('/]path to]/cert.pem'),
      passphrase: 'password',
      headers: {
      'Host': 'rests_client.xxx.xxxx.com'
      }
      }

      request(option,function (error, response, body) {
      if (error) {
      return console.error('upload failed:', error);
      }
      console.log('Upload successful! Server responded with:', body);
      });


      I'm getting the following error:



      upload failed: { Error: write EPROTO 4552209856:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1498:SSL alert number 40
      4552209856:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:659:

      at WriteWrap.afterWrite [as oncomplete] (net.js:868:14) errno: 'EPROTO', code: 'EPROTO', syscall: 'write' }


      I really can't understand what am I missing.










      share|improve this question
















      I have valid ssl certificate pem file.



      openssl rsa -in cert.pem -passin "pass:password"
      writing RSA key

      -----BEGIN RSA PRIVATE KEY-----
      MIIEpAIBAAKCAQEAwqsU4MqkLOhm6xoueHu6x4U0zBBgcY+dQra3xD2ZJTXtvxDQ
      ...
      ...
      ...
      jKV7oDM0gfEF1bq0OQD0uTaNDvLXWBFaBKx5yxahr1+LL6H1r5wK6Q==
      -----END RSA PRIVATE KEY-----


      I'm using valid proxy server, which works fine in my browser and uses standard http protocol.



      now when I'm running my node.js code.



      var fs = require('fs');
      var request = require('request');

      const data = JSON.stringify({
      "compression": "lz4", "replay" : false
      });
      var proxyServer = 'http://webproxy.e.corp.services:80';

      var option = {
      proxy: proxyServer,
      method: 'POST',
      url: 'https://10.51.13.6:8301/request/stream',
      json: data,
      ca: fs.readFileSync('/]path to]/cert.pem'),
      passphrase: 'password',
      headers: {
      'Host': 'rests_client.xxx.xxxx.com'
      }
      }

      request(option,function (error, response, body) {
      if (error) {
      return console.error('upload failed:', error);
      }
      console.log('Upload successful! Server responded with:', body);
      });


      I'm getting the following error:



      upload failed: { Error: write EPROTO 4552209856:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1498:SSL alert number 40
      4552209856:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:659:

      at WriteWrap.afterWrite [as oncomplete] (net.js:868:14) errno: 'EPROTO', code: 'EPROTO', syscall: 'write' }


      I really can't understand what am I missing.







      node.js http ssl https request






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 13:53







      danny.lesnik

















      asked Nov 15 '18 at 11:00









      danny.lesnikdanny.lesnik

      14.3k23112183




      14.3k23112183
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317958%2fnode-https-request-failure-through-proxy-server%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317958%2fnode-https-request-failure-through-proxy-server%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python