telepot
telepot copied to clipboard
aiohttp_skeletona webhook example not working ?
I can't seem to get the webhook example to work.
I start the example with
$ python3.5 aiohttp_skeletona.py <mytoken> 8443 https://my.url/webhook/
And then from another console I do
curl -v -k -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{
"update_id":10000,
"message":{
"date":1441623432,
"chat":{
"last_name":"Test Lastname",
"id":88162342,
"type": "private",
"first_name":"Test Firstname",
"username":"usern"
},
"message_id":1365,
"from":{
"last_name":"Test Lastname",
"id":1111111,
"first_name":"Test Firstname",
"username":"Testusername"
},
"text":"wei"
}
}' "https://my.url:8443/webhook/"
But I get:
* Trying the.ip.ip.ip ....
* Connected to my.url (the.ip.ip.ip) port 8443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 694 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* gnutls_handshake() failed: An unexpected TLS packet was received.
* Closing connection 0
curl: (35) gnutls_handshake() failed: An unexpected TLS packet was received.
And on the server side I get
======== Running on http://0.0.0.0:8443 ========
(Press CTRL+C to quit)
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/aiohttp/web_protocol.py", line 278, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
File "aiohttp/_http_parser.pyx", line 273, in aiohttp._http_parser.HttpParser.feed_data (aiohttp/_http_parser.c:4351)
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
Any ideas?
Did you manage to solve it? I get the same error and I do not understand why
may be you need turn on the https?