I am using telegram.php
to connect my bot. When I use sendmessage
all of thing is ok in my logs but I do not receive anything from the bot.
When I check my log there is a problem like this:
ok: False
curl_error_code: 51
curl_error: SSL: no alternative certificate subject name matches target host name 'api.telegram.org'
I donit know what to do to fix it.
2
Answers
I don’t know this telegram bot, but I see that it uses GuzzleHttp.
During the initialization it doesn’t accept any configuration
Request::initialize()
you should check its documentation. I see that there are a lot of setters which makes you able to overwrite the default settings.
What you need is to set the the
GuzzleHttpRequestOptions::VERIFY
tofalse
in the client config:For fix this problem copy this Url to browser and set webhook:
Solution 2 of The Error
Let’s follow these simple steps:
Download this bundle of root certificates: https://curl.haxx.se/ca/cacert.pem
Put in any location of your server.
Open php.ini and add this line:
Restart your webserver.
That’s it. 🙂