luastoned / turbo-telegram Goto Github PK
View Code? Open in Web Editor NEWTelegram (https://telegram.org/) bot wrapper for Turbo.lua (http://turbolua.org)
License: MIT License
Telegram (https://telegram.org/) bot wrapper for Turbo.lua (http://turbolua.org)
License: MIT License
I'm trying to use turbo-telegram using webhook
on my VPS.
Because of this I have to setup ssl key/cert and pass them to turbo
. I successfully setup key/cert and turbo
accept ssl requests. I mean for example with helloworld.lua
example https://example.com/hello
correctly prints Hello World!
. (I also tested letsencrypt )
This is how I setup my application:
TURBO_SSL = true
local telegram = require("turbo-telegram/telegram")
local turbo = require("turbo")
local bot_token = "xxxx:xxxxxxxxxxxx"
telegram.setBotToken(bot_token)
local BotHandler= class("BotHandler", turbo.web.RequestHandler)
function BotHandler:get(arg1, arg2)
if arg1 == "hello" then
self:write("Hello World!")
else
self:write("arg1: "..arg1.." - arg2: "..(arg2 or "NO_ARG2"))
end
end
local SSL_CERT_FILE_PATH = "/path/to/cert.pem"
local SSL_KEY_FILE_PATH = "/path/to/privkey.pem"
turbo.web.Application({
{"/([a-zA-Z0-9]+)/(.*)", BotHandler}
}
):listen(443, turbo.socket.INADDR_ANY, {
ssl_options = {
key_file = SSL_KEY_FILE_PATH,
cert_file = SSL_CERT_FILE_PATH
}
}
)
turbo.ioloop.instance():start()
but after I set https://example.com
as webhook (directly not by turbo-telegram) it repeatedly prints the following error:
▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
[E 2016/04/28 21:06:35] [ioloop.lua] Error in IOLoop handler.
▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
/usr/local/share/lua/5.1/turbo/crypto_linux.lua:290: Could not do SSL handshake.
SSL error. error:14094418:SSL routines:ssl3_read_bytes:tlsv1 alert unknown ca
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/turbo/crypto_linux.lua:290: in function 'ssl_do_handshake'
/usr/local/share/lua/5.1/turbo/iostream.lua:1197: in function '_do_ssl_handshake'
/usr/local/share/lua/5.1/turbo/iostream.lua:1213: in function '_handle_read'
/usr/local/share/lua/5.1/turbo/iostream.lua:484: in function </usr/local/share/lua/5.1/turbo/iostream.lua:475>
[C]: in function 'xpcall'
/usr/local/share/lua/5.1/turbo/ioloop.lua:541: in function '_run_handler'
/usr/local/share/lua/5.1/turbo/ioloop.lua:453: in function '_event_poll'
/usr/local/share/lua/5.1/turbo/ioloop.lua:442: in function 'start'
test.lua:28: in main chunk
[C]: at 0x00404d60
▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
What's going wrong? Why telegram cant handshake
to webhook URL?
unknown ca
? I uploded cert file when setting webhook
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.