skip to Main Content

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:xampphtdocs 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 ‘TelegramBotExceptionsTelegramSDKException’ 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:xampphtdocsbotvendorirazasyedtelegram-bot-sdksrcHttpClientsGuzzleHttpClient.php:114 Stack trace: #0 C:xampphtdocsbotvendorirazasyedtelegram-bot-sdksrcTelegramClient.php(117): TelegramBotHttpClientsGuzzleHttpClient->send(‘https://api.tel…’, ‘POST’, Array, Array, 60, false, 10) #1 C:xampphtdocsbotvendorirazasyedtelegram-bot-sdksrcApi.php(1014): TelegramBotTelegramClient->sendRequest(Object(TelegramBotTelegramRequest)) #2 C:xampphtdocsbotvendorirazasyedtelegram-bot-sdksrcApi.php(958): TelegramBotApi->sendRequest(‘POST’, ‘getMe’, Array) #3 C:xampphtdocsbotvendorirazasyedtelegram-bot-sdksrcApi.php(269): TelegramBotApi->post(‘getMe’) #4 C:xampphtdocsbotmain.php(20): TelegramBotApi->getMe() #5 {main} thrown in C:xampphtdocsbotvendorirazasyedtelegram-bot-sdksrcHttpClientsGuzzleHttpClient.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.

2

Answers


  1. Chosen as BEST ANSWER

    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).


  2. go to the file vendorirazasyedtelegram-bot-sdksrcHttpClientsGuzzleHttpClient.php
    Changing the setting

       public function __construct(Client $client = null)
    {
     $this->client = $client ?: new Client();
    }
    

    on

        public function __construct(Client $client = null)
    {
    $this->client = $client ?: new Client(['verify' => false ]);
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search