ngrok having issues starting - X509 certificate signed by unknown authority - ngrok

I'm using ngrok 3.1.1 and trying to open up port 8000 so I can do some local testing. However, I keep running into some issues.
First off, I've downloaded and installed ngrok from the official site, and then added by authorisation token using:
ngrok config add-authtoken blahblahblahcrazywordsmoustache
So far so good. Then, trying to open ngrok using:
ngrok http 8000
Yields the following errors:
reconnecting (x509: certificate signed by unknown authority)
Followed by:
reconnecting (jsonHTTP.Lookup: No such host: tunnel.ngrok.com)
And...
reconnecting (resolved tunnel.ngrok.com has no records)
The ngrok.yml looks like this:
root_cas: trusted
version: "2"
authtoken: ohlooksomelettersarenttheynice
Any idea what I can do? This is on a corporate network, with various firewalls etc. I'm told that ngrok will create a url that I can use in my code tests, but we can't whitelist that url until we know what it is, and we don't know what it is until ngrok starts and generates it.

Okay, not quite a solution but more of a work-around.
Disconnected my computer from the corporate network, used a wifi dongle and hotspotted to my phone.
Got an error saying that my account wasn't authorised to use custom CAs. Wracked my head for a bit until I remembered that I had seen cas before, in the yml file. Removed the
root_cas: trusted
from the yml, and all working fine and dandy.

Related

unable to send API request to Solana devnet

I'm doing the following tutorial of creating tokens on Solana.
https://spl.solana.com/token
and it seems that all requests to Solana devnet are failing
$spl-token create-token
Creating token 2rxgzZ1tk692aZJXDz8NhTkVXQWB396Z3L21nTUYWCFi
error sending request for url (https://api.devnet.solana.com/): error trying to connect: invalid certificate: UnknownIssuer
I'm not so much of an expert when it comes to network, but i thought it was permission issue in firewall as I am currently working on this in corporate environment.
but as I tested with telnet, it doens't seem like a firewall issue
147.28.33.107 is an IP address of Solana devenet network.
telnet 147.28.33.107 80
I have the similar problem but I sorted out by specifying the path to my-keypair.json.

Deno Server doesn't go through the Internet

I built a simple Webserver with just the serve function from the std http module. It just redirects a request to a new URL:
import { serve } from "https://deno.land/std#0.120.0/http/server.ts";
serve(req => Response.redirect("https://google.com"))
It works, when I access the server through a browser on my laptop, where the server is running, but when I try to access it on another machine in the same network using the ip-address of my laptop, there simply is no response at all. Is this one of the security features Deno has and if so, how can you deactivate it?
Update:
So I tried looking up the requests I make on my local machine in Wireshark, but when I run the server and send a request, it doesn't show up there. I disabled my Wifi Connection to see if that changes anything and to my surprise, I still got an answer from the server when I sent a request through the browser. I came to the conclusion that the Deno server somehow doesn't serve over the local network which really confuses me. Is there a way to change that behaviour?
This is not related to Deno, but rather the firewall features of your device/router/network or an error in the method that you are using to connect from the other device (typo, network configuration, etc.).
Without additional configuration (by default), serve binds to 0.0.0.0:8000, so — as an example — if your laptop is assigned the local address 192.168.0.100 by your router, you could reach the server at the address http://192.168.0.100:8000.
You might want to do research on SE/NetworkEngineering and elsewhere to determine the cause of the blocked connection.

Ngrok can't read config for ports

So, I'm currently setting up a Raspberry Pi to be my testing server and to host code backups over SFTP(I really don't like Git). After tussling with Hamachi for a bit, I was recommended Ngrok. Installing Ngrok, I was able to open a port just fine without a config file. It was at this point that I decided that I'd want multiple ports open. I read through the documentation, and wrote this config file.
authtoken:(REDACTED)
tunnels:
httpnorm:
proto: http
addr: 80
httptest:
proto: http
addr:69420
sftp1:
proto: tcp
addr:22
sftp2:
proto:tcp
addr: 21
Now, this is a completely fine YAML file, I've even checked it for error twice, so the formatting doesn't appear to be an issue. However, upon running the command "./ngrok start -config='ngroksetup.yml' sftp1", I get the following output.
ERROR: Tunnel 'sftp1' is not defined in the config files.
ERROR: Tunnels available:
ERROR: Config files read: [ngroksetup.yml]
That isn't correct, because ngroksetup.yml(which is on the root of the filesystem) clearly has listed tunnels. Why is it incorrectly interpreting the setup file?
User error. The issue would be obvious from the get go if I had included my auth token, but I didn't want my auth token being stolen for obvious reasons. Thankfully, the way I wrote it kind of gives it away. I needed a space between the : and the auth token itself, just like how I missed the space on the (REDACTED).

I am not not able run an website in localhost

This site can’t provide a secure connection localhost sent an invalid response.
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR
When running a service or site locally you can avoid this problem by doing the following:
In project properties enable SSL:
Make sure to put https link as a start URL or just make direct request to https version:

ngrok - Get all routes to localhost server

I'm using ngrok (free account) in my localhost for my coded web server written in Go
In Ubuntu, after starting my server (which listens on port 3000), I run this command to start ngrok:
./ngrok http 3000
Then other PC can get access to my demo web by path provided by ngrok, for instance, http://6fed323a.ngrok.io
But when they do something on it (for example, click on a button that redirects), the host of URL becomes localhost again
There isn't any functions of ngrok that allows access to all routes in server, is there? I'm learning
I just ran into this issue, the reason for this is because your button uses a straight absolute path redirect which ngrok (or any tunneling service ive used so far) cannot handle. You need to use a relative path redirect such as:
window.location.href = '/path';
In general, it is considered best practice to always use relative urls so that the app is not bound to the hostname. Of course, this is in an ideal work- most legacy apps may not follow this unfortunately.
While I was working on a Rails app I wanted to run it on ngrok but I got error below:
The connection to http://xxxxxx.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:3000.
It seems like ngrok works fine but my local server is not. Which is true since I forgot to run my rails app first by run $ rails s. By doing so I was able to get ngrok tunneing works fine.
Make sure your local server run first.
I have noticed ngrok url changes to localhost url when I click on site logo which is defined as root_path in my route file. But other links and header tabs for example works fine and shows ngrok url.
Good luck.

Resources