Some time ago I started creating my own telegram-bot. I've some simple code and set up a project via composer. I plan to use xampp as a Server-software. I've created a directory in the C:\xampp\htdocs
directory and called it bot
. Inside the directory there is my code, including the composer.json
and vendor/
directory.
When I run the apache server and open http://localhost/bot/main.php (which is the main-document), I get the following error:
Output of http://localhost/bot/main.php:
Fatal error: Uncaught exception 'Telegram\Bot\Exceptions\TelegramSDKException' with message 'cURL error 60: SSL certificate problem: self signed certificate in certificate chain (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in C:\xampp\htdocs\bot\vendor\irazasyed\telegram-bot-sdk\src\HttpClients\GuzzleHttpClient.php:114 Stack trace: #0 C:\xampp\htdocs\bot\vendor\irazasyed\telegram-bot-sdk\src\TelegramClient.php(117): Telegram\Bot\HttpClients\GuzzleHttpClient->send('https://api.tel...', 'POST', Array, Array, 60, false, 10) #1 C:\xampp\htdocs\bot\vendor\irazasyed\telegram-bot-sdk\src\Api.php(1014): Telegram\Bot\TelegramClient->sendRequest(Object(Telegram\Bot\TelegramRequest)) #2 C:\xampp\htdocs\bot\vendor\irazasyed\telegram-bot-sdk\src\Api.php(958): Telegram\Bot\Api->sendRequest('POST', 'getMe', Array) #3 C:\xampp\htdocs\bot\vendor\irazasyed\telegram-bot-sdk\src\Api.php(269): Telegram\Bot\Api->post('getMe') #4 C:\xampp\htdocs\bot\main.php(20): Telegram\Bot\Api->getMe() #5 {main} thrown in C:\xampp\htdocs\bot\vendor\irazasyed\telegram-bot-sdk\src\HttpClients\GuzzleHttpClient.php on line 114
I don't know what exactly the problem is, it seems to be an issue with a self-signed certificate, but I don't get what is the explicit problem and how to fix it.
I hope you can help me with an answer here.
UPDATE:
I finally decided to switch to the GoogleAppEngine, so I don't have to worry about untrusted certificates and so on, now everything is working fine. But thanks for your help anyway (especially @LifeTimeProgrammer).