How can I let Ngrok provide both https and https tunnels by default for all endpoints? - ngrok

By default, ngrok only provides https tunnel.
I can specify which tunnel has https or http or both in the config file, but if so, I will have to start this tunnel every time. What I want to do it when I try to run any http port nubmer like ngrok http 5000, ngrok will automatically offers https and http for it.
I have tried
version: "2"
authtoken: faswETNFAW8DSmVuHrOH18s_6pK7iP5
schemes: [http,https]
but got the error.
How can I config the ngrok config file correctly?

Related

Ngrok tunnel https via config

I am having some issues finding how to properly write my ngrok.yml file such that it will start the tunnel using https. What I have at the moment is the following:
tunnels:
invenutory:
proto: http
addr: 44328
host_header: localhost
The issue here is that if I use the url ngrok gives me it does not connect (i test this by seeing if it hits my healthcheck endpoint, it does not). However, if I start ngrok using the following command:
ngrok http https://localhost:44328 -host-header="localhost:44328" then it will properly hit my endpoint. How can I make my config file act the same way?
Edit:
If I set the addr to be addr: "https://localhost:44328" then it does properly use https, but for some reason this seems to me like an incorrect way of doing it.
To start a https only tunnel with a ngrok http tunnel, use the flag -bind-tls.
This is unrelated to how you use addr, which can be used to let ngrok know if your local server is listening for http or https.
From the docs:
ngrok assumes that the server it is forwarding to is listening for unencrypted HTTP traffic, but what if your server is listening for encrypted HTTPS traffic? You can specify a URL with an https:// scheme to request that ngrok speak HTTPS to your local server.
You can add the bind_tls flag to the config file to create only HTTPS tunnels as per the docs
tunnels:
invenutory:
proto: http
addr: 44328
host_header: localhost
bind_tls: true

How to can http services from https server

I have apache server(Frontend code) running on 80 port with https secure(SSL is configured). Backend server is nodejs and it is configured on 3000 port. When I tried to call services from https to http i.e. Apache(port 80 ssl configured) to Nodejs (port 3000 non-ssl) it is giving showing failed with status as "net::ERR_SSL_PROTOCOL_ERROR".
This may have something to do with Same Origin policy.
Please see that answer: HTTP Ajax Request via HTTPS Page.

Jenkins Service to redirect http:servername:8080 to https:servername:8080

We used http:servername:8080 when configured jenkins. Later we enabled ssl and made the jenkins access under https:servername:8080. But We want to redirect http:servername:8080 to https:servername:8080. Can you please help us here.
First of all you need to change the port for https connections, because the server can not listen on the same port for the same protocol (in your case TCP protocol and port 8080).
For example, you can configure https to a default 443 port.
Regarding redirection, actually, it is recommended to put a reverse proxy in front of the jenkins server. See official documentation about running jenkins with SSL https://wiki.jenkins.io/pages/viewpage.action?pageId=135468777.
Here is the manual how to configure jenkins behind an nginx reverse proxy with http to https redirection: https://wiki.jenkins.io/display/JENKINS/Jenkins+behind+an+NGinX+reverse+proxy

How to handle https request if ssl is not installed on server using codeigniter

I just tried with http ans https to fetch data in the for of json from server, while I try with http its working fine but when I try with https getting error. Is there any way to handle "https" request if server is not cofigured with SSL.
no, there isn't any way if the server isn't configured to user SSL. However if you want TLS encryption you could use a SSH tunnel. If you can't configure your application to use SSL you could configure a http server like Apache or nginx to act as an SSL Proxy.

Transparent proxy through another proxy using HTTP CONNECT

I have a few legacy clients that don't "speak" HTTPS which I've connected to an upstream server serving content only over HTTPS using nginx as a reverse proxy. This is the flow:
(1) client -> (2) nginx:80 redirects to https -> (3) upstream server
The problem now is in front of (3) there is a forwarding proxy I have to go through, proxy which does HTTPS over HTTP Connect and I have a hard time finding a way to somehow bridge (or replace completely) nginx over HTTP Connect:
(1) client -> (2) nginx:80 redirects to https -> (3) proxy HTTP CONNECT -> (4) upstream
Any ideas what should go in or instead of the bold component ?
I've looked at tinyproxy but that expects HTTP Connect directly (which nginx does not support) and squid which I cannot figure out how to configure to do HTTPS over HTTP CONNECT.
I am essentially looking for a way to bridge http to https through a proxy, please ignore any product names and feel free to suggest anything - including code samples. The clients as well as the server are part of my application.

Resources