There is a related closed issue on this but the resolution doesn’t work.
I have the latest install of n8n running on Windows 11.
I have created a Telegram OnMessage trigger. The URL in the webhook it is always HTTP.
I have tried all sorts of ways to make it use https but nothing works.
I run n8n using: npx n8n
the error is:
Telegram Trigger: Bad Request: bad webhook: an HTTPS URL must be provided for Webhook.
I have tried setting the WEBHOOK_TUNNEL_URL in the config file.
I have tried setting the WEBHOOK_TUNNEL_URL in the .env file.
The version of n8n is 1.76.3
I am running it as npx n8n
There is no database involved, the automation only has a Telegram onmessage trigger
here is my entire workflow:
Use the Docker Compose setup for running n8n with Ngrok as a tunneling service. n8n is a workflow automation tool that allows you to connect different services and APIs. Ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels.
I have tried for 12 hours to set up my n8n to run locally using Docker, ngrok and nginx. But I cannot get it to work. The result is that by adding and removing containers in multiple attempts, I deleted all of my workflows and now have to rebuild them.
n8n needs to address this and make it far easier to implement - very disappointed.
so I will switch to the cloud-based version to implement my workflows.
Try this (step by step and eventually it worked, I’m working in Linux Mint, if you are in Windows, adapt your comamnds accordingly):
I used Gemini to worked it out
sudo apt install mkcert
mkcert -install
restart n8n
after installation you must edit n8n config file and add/modify JSON file
{
“protocol”: “https”,
“port”: 8443,
“sslCert”: “path-to/localhost.pem”,
“sslKey”: “path-to/localhost-key.pem”
}
If it does’nt work, change env variable (choose your port within Telegram range)
$ export N8N_PORT=8443 (it was the last thing that I use and after this I have now https on 8443)
export N8N_PROTOCOL=https
export N8N_SSL_CERT=“path-to/localhost.pem”
export N8N_SSL_KEY=“path-to/localhost-key.pem”
restart n8n, restart browser
One of above will work or ask Gemini or another AI BUT
It willl not work if you have’nt public IP, so figure it out, because I’m not in that place