google-gemini-php / laravel

⚡️ Gemini PHP for Laravel is a community-maintained PHP API client that allows you to interact with the Gemini AI API.
MIT License
252 stars 29 forks source link

SSL disabling #2

Closed hellanya925 closed 4 months ago

hellanya925 commented 4 months ago

There is no clear method to disable ssl verification.

backendrulz commented 4 months ago

Where? do you have any example?

hellanya925 commented 4 months ago

The point is im using a testing environment with no ssl certificate. Rhis package is probably built on top of a curl request. When i try to use it, a "no ssl certificate" error pops up. While using native curl requests in php, we can disable ssl verification (curl_set_opt...).

On Wed, 28 Feb 2024, 1:20 am Cristian Ferreyra, @.***> wrote:

Where? do you have some example?

— Reply to this email directly, view it on GitHub https://github.com/google-gemini-php/laravel/issues/2#issuecomment-1967896004, or unsubscribe https://github.com/notifications/unsubscribe-auth/APU44VU7AOGBHKZWVKSNRB3YVZS5FAVCNFSM6AAAAABD3UYNZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRXHA4TMMBQGQ . You are receiving this because you authored the thread.Message ID: @.***>

aydinfatih commented 4 months ago

Hello @hellanya925, First of all, thank you for your feedback.

I think it would not be right to disable SSL requests on a package-specific basis. The problem may be related to your PHP configuration.

Can you try the solution on the site below? https://wpquark.com/kb/misc/server-management/fixing-curl-ssl-connection-issue-php-ini/

jhoanborges commented 1 month ago

maybe related to guzzle:

$this->client = new GuzzleClient(['defaults' => [ 'verify' => false ]]);

according to the main package, you can do like the following using withHttpClient:

Gemini::factory()
    ->withApiKey($apiKey)
    ->withHttpClient(new \GuzzleHttp\Client(['timeout' => $timeout]))
    ->make();