Code Monkey home page Code Monkey logo

turbo-telegram's People

Contributors

luastoned avatar srazi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

turbo-telegram's Issues

Using turbo-telegram for getting update by webhook

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.