how to connect to remote tomcat via tls from node-proxy server - node.js

I have configured tomcat to accept ssl connection by configuring the keystore. since my tomcat server handles application specific rest api calls. I want to setup a node-proxy server to proxy the request for https to tomcat, can anyone please educate me regarding how to achieve this.

you should work with node request module.
Steps to send a https request to a rest service in Node js - this answer may help you.
Thanks

Related

Having issues running Nodejs and React side with IIS running HTTPS

I am having issues with running NodeJS as a backend for a React application (website) when utilizing HTTPS. The NodeJS runs on port 3001 waiting for requests. When React is running on IIS on HTTP and queries NodeJS (http://localhost:3001) everything is fine. However if I deploy SSL on the React application then the communication between React and NodeJS fails. I believe it is the security restriction of HTTPS and HTTP interacting.
The question then is, how do I run node on port 3001 but on HTTPS to deal with HTTPS origin requests?
I have looked at Reverse Proxy (https://dev.to/petereysermans/hosting-a-node-js-application-on-windows-with-iis-as-reverse-proxy-397b), looked at IISnode which doesn't seem to be supported anymore and read up on running NodeJS on HTTPS (which doesn't seem to be a viable solution).
Looking for any guidance and direction.
Much appreciated.
Ok, typical that 10 minutes after you ask, you figure it out.
This is how I resolved the issue and someone more knowledgeable might correct me.
On IIS you have your HTTPS React website
Create a second Website on IIS (that also has SSL installed so can be accessed through Https).
On this second website you install the reverse proxy solution (https://dev.to/petereysermans/hosting-a-node-js-application-on-windows-with-iis-as-reverse-proxy-397b) and route the requests to port 3001 on NodeJS application.
Effectively this means that the React application running on Https can now call NodeJS on Https (e.g. https://mynode.mysite.com) and the reverse proxy forwards the request to the NodeJS application on port 3001 (or the port that you are running NodeJs).
If I am wrong (this worked for me) or have gone the long route, please feel free to correct.
Thank you.

node server placed behind proxy server failed to GET request to https://localhost:<port>

On my machine, im hosting a node server that is listening on port 5000. Before setting up a forward proxy (squid), i was able to perform a GET on https://localhost:<port>. However, after setting up a forward proxy and setting the environmental variable http_proxy=<ip addr:port>, this GET request no longer works.
The error that shows up is: tunnelling socket could not be established, statusCode=503
Some additional information:
The proxy server works as I am able to connect to the internet via it.
Performing curl instead, on the https:localhost:5000/api works.
Am using request.js for the requests, using agentOptions to specify TLS protocols & ca cert.
I am hoping to understand how the traffic is now different after i add in a proxy. From my understanding, now we have to go through a sort of TLS CONNECT / tunnelling since to the proxy first, since its a HTTPS request, before coming back to my localhost. But in the case without the proxy, how is it that its working?
Any help would be greatly appreciated. Thanks!
you must add
export no_proxy='localhost,127.0.0.1'
the https work because you don't use proxy for https , you must set https_proxy='<tour_proxy>'

Is SSL recommended for node.js behind proxy

Using Apache as proxy, I'm forwarding requests to a specific URL to a node server which is running on localholt.
While the request send to apache is already on SSL/HTTPS, I'm wondering if it's preferable/required to also run my node server with SLL/HTTPS.
Can someone provide me with some details about this please?

how to access own Node.js server in https web site which deployed in nginx

i do deploy a website in nginx and translate it from http to https using let's cerbot before. it runs well.
My question is, in my website, i need to access my own Node.js Server using axios. As before, i used http, it goes well expect security.But now, below the Https connect, the browser blocks my http connect.So i tried update my Node Server to support Https connect using Self-signed SSL certificates, but the browser blocks it as well.
Who can tell me how can i fix this problem and make the site work well.Thank you!
You should setup nginx as reverse proxy for nodejs server

Need help http Server and client server

I have used an application for login, adding friends and chat using node.js and mongoDB.I installed the node.js and monogoDB on ec2 instance. However, I do not know if need to use client server and http server?
Here is the application that I used https://github.com/1karthik/Node.js_UserLogin_Template
note: I am new to node.js and mongoDB
you dont need a "client server". Your http server will serve to your clients some javascript files that will help them to comunicate with your server. If you go in app/public/scripts you can see theese files.

Resources