Q&A

Webhook not working for NGROK test endpoints, but ok for Heroku test endpoint

I am working on a chatbot for object detection from image messages. It is easier to test with my local machine than the Heroku server so I have ngrok service to redirect HTTP/HTTPS connections to my local machine.

Procedure for finding the issue:

  1. use ngrok to make HTTP/HTTPS tunnel for my computer as https://xxxxx.ngrok.io/webhook.
  2. Use Postman to POST request with empty 'X-Line-Signature' -> ok, rejected due to invalid signature.
  3. Use [Verify] button to test endpoint -> "An error occurred when sending the webhook" + no log about POST request from LINE server.
  4. Re-deploy ngrok tunnel.

My expectation is about invalid certificate. So use Chrome to verify certificate of https://xxxxx.ngrok.io, it is ok anyway.

  1. Issued to *.ngrok.io
  2. Issused by RapidSSL RSA CA 2018
  3. Root CA = Digicert Global Root CA

Listed as "CN=DigiCert Global Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US" at the last line of https://developers.line.biz/media/messaging-api/build-bot/ca_root_v2.txt

  • 2
  • 5
  • 2760
  • twitter facebook

More info from LINE Dev Thailand channel on YouTube (in Thai) https://www.youtube.com/watch?v=oxE4Ri_z__E

Change region of NGROK from USA (default) to Japan solve the problem.

  • 0

Thank you, Supachai! I use localhost.run instead of ngrok for a while...

LINE corp, please please fix this issue as it's so painful for many developers if ngrok cannot be used.

  • 0

I am also facing the same problem. Does LINE have a solution for developer testing?

  • 0

I have the same problem too. NGROK was working a few weeks ago, but not anymore. When clicking 'Verify' this error shows: "An error occurred when sending the webhook" and no request was sent to the url. Does Line provide any guides or best practices for local development?

  • 0

[Serveo] server not working now, so I changed localhost.run. One step more to generate SSH key, not a big deal. You may try it.

  • 1
本当によろしいですか? question.vm