2
votes

I have problem with https://core.telegram.org/bots.

  1. Get token from BotFather.
  2. Create self-signed ssl sertificate (https://core.telegram.org/bots/self-signed):

    openssl req -newkey rsa:2048 -sha256 -nodes -keyout YOURPRIVATE.key -x509 -days 365 -out YOURPUBLIC.pem -subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=YOURDOMAIN.EXAMPLE"

  3. Run server:

    openssl s_server -accept 88 -key YOURPRIVATE.key -cert YOURPUBLIC.pem

  4. Send hook:

    curl -F "url=https://URL:88/bot" -F "[email protected]" https://api.telegram.org/botTOKEN/setWebhook

Answer:

{"ok":true,"result":true,"description":"Webhook was set"}
  1. Telegram connect to my server. Error:

    139690177754952:error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown:s3_pkt.c:1257:SSL alert number 46

  2. Test:

    openssl s_client -connect URL:88

OK. No problem.

How to:

  1. Run openssl s_client ... as Telegram. Use -cert YOURPUBLIC.pem not work.
  2. Fix this problems and recive data.
1
How did you get the Telegram log row (5° point)?Valerio Bozz

1 Answers

2
votes

Need set real server name to sertificate CN, equal URL(4).