Coder Social home page Coder Social logo

Comments (12)

tbarbugli avatar tbarbugli commented on June 11, 2024

Hi,

Thank you for reaching us. It seems like the certificate keychain used by
php curl is out of date or missing (and/or you do not have openSSL
installed). I suggest you to follow the steps from this guide (section 3 is
the most relevant) http://support.gnip.com/articles/curl-on-win7.html

Please let us know if you need more help with this issue.

Best,
Tommaso

On Wed, Apr 1, 2015 at 8:46 AM, Tommy Nguyen [email protected]
wrote:

Fatal error: Uncaught exception 'GuzzleHttp\Ring\Exception\RingException'
with message 'cURL error 60: SSL certificate problem: self signed
certificate in certificate chain' in
C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php:126
Stack trace: #0
C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php(90):
GuzzleHttp\Ring\Client\CurlFactory::createErrorResponse(Object(GuzzleHttp\Ring\Client\CurlHandler),
Array, Array) #1 #1
C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlHandler.php(78):
GuzzleHttp\Ring\Client\CurlFactory::createResponse(Object(GuzzleHttp\Ring\Client\CurlHandler),
Array, Array, Array, Resource id #68) #2
#2
C:\workspace\app\vendor\guzzlehttp\ringph p\src\Client\Middleware.php(54):
GuzzleHttp\Ring\Client\CurlHandler->__invoke(Array) #3
#3
C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\Middleware.php(30):
GuzzleHttp\Ring\Client\Middleware::GuzzleHttp\Ring\Client{closure}(Array)
#4 #4
C:\workspace\app\vendor\guzzlehttp\guzzle\src\RequestFsm.php(129):
GuzzleHttp\Ring\Cli in
C:\workspace\app\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php
on line 51

I would appreciate if you could help me get around this error


Reply to this email directly or view it on GitHub
#15.

from stream-php.

tn222eb avatar tn222eb commented on June 11, 2024

I have followed your steps and also searched google for further help but to
no success.

Can you please help me, the api still dont work

2015-04-01 14:53 GMT+02:00 Tommaso Barbugli [email protected]:

Hi,

Thank you for reaching us. It seems like the certificate keychain used by
php curl is out of date or missing (and/or you do not have openSSL
installed). I suggest you to follow the steps from this guide (section 3 is
the most relevant) http://support.gnip.com/articles/curl-on-win7.html

Please let us know if you need more help with this issue.

Best,
Tommaso

On Wed, Apr 1, 2015 at 8:46 AM, Tommy Nguyen [email protected]
wrote:

Fatal error: Uncaught exception 'GuzzleHttp\Ring\Exception\RingException'
with message 'cURL error 60: SSL certificate problem: self signed
certificate in certificate chain' in
C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php:126
Stack trace: #0

C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlFactory.php(90):

GuzzleHttp\Ring\Client\CurlFactory::createErrorResponse(Object(GuzzleHttp\Ring\Client\CurlHandler),
Array, Array) #1 #1

C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\CurlHandler.php(78):

GuzzleHttp\Ring\Client\CurlFactory::createResponse(Object(GuzzleHttp\Ring\Client\CurlHandler),
Array, Array, Array, Resource id #68) #2
#2
C:\workspace\app\vendor\guzzlehttp\ringph
p\src\Client\Middleware.php(54):
GuzzleHttp\Ring\Client\CurlHandler->__invoke(Array) #3
#3
C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\Middleware.php(30):
GuzzleHttp\Ring\Client\Middleware::GuzzleHttp\Ring\Client{closure}(Array)
#4 #4
C:\workspace\app\vendor\guzzlehttp\guzzle\src\RequestFsm.php(129):
GuzzleHttp\Ring\Cli in

C:\workspace\app\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php
on line 51

I would appreciate if you could help me get around this error


Reply to this email directly or view it on GitHub
#15.


Reply to this email directly or view it on GitHub
#15 (comment).

from stream-php.

davgothic avatar davgothic commented on June 11, 2024

1, Download the Certficate Authority Bundle and save it somewhere locally.
2, Instantiate a feed object like so $user_feed = $client->feed('user', '1');
3, Add a default option to the Guzzle HTTP client for that feed like so $user_feed->setGuzzleDefaultOption('verify', '/absolute/path/to/cacert.pem'); This will have to be done for every feed you instantiate because as far as I am aware GetStream haven't provided us with a method to set a global option on the HTTP client or a method of passing our own in.

Full example:

// Instantiate a feed object
$user_feed = $client->feed('user', '1');

// You have to manually set the path to the cacert.pem. This must be absolute.
$user_feed->setGuzzleDefaultOption('verify', '/absolute/path/to/cacert.pem');

$feed->addActivity([
    'actor' => 'User:2',
    'verb' => 'review',
    'object' => 'Review:'.$review->id,
]);

I hope this helps somebody.

from stream-php.

tbarbugli avatar tbarbugli commented on June 11, 2024

David's suggestion is correct. I am going to add support for options to be
defined at client level and add mention this specific use use case in the
readme.

On Tue, Apr 28, 2015 at 1:10 PM, David Hancock [email protected]
wrote:

1, Download the Certficate Authority Bundle
http://curl.haxx.se/ca/cacert.pem and save it somewhere locally.
2, Instantiate a feed object like so $user_feed = $client->feed('user',
'1');
3, Add a default option to the Guzzle HTTP client for that feed like so $user_feed->setGuzzleDefaultOption('verify',
'/absolute/path/to/cacert.pem'); This will have to be done for every feed
you instantiate because as far as I am aware GetStream haven't provided us
with a method to set a global option on the HTTP client or a method of
passing our own in.

Full example:

// Instantiate a feed object
$user_feed = $client->feed('user', '1');

// You have to manually set the path to the cacert.pem. This must be absolute.
$user_feed->setGuzzleDefaultOption('verify', '/absolute/path/to/cacert.pem');

$feed->addActivity([
'actor' => '\Inviite\Model\User:2',
'verb' => 'review',
'object' => 'Review:'.$review->id,
]);

I hope this helps somebody.


Reply to this email directly or view it on GitHub
#15 (comment).

from stream-php.

MasterB avatar MasterB commented on June 11, 2024

hi, no @davgothic it's not solve my problem. thanks.
on guzzle 5, there was no problem with it.

from stream-php.

tbarbugli avatar tbarbugli commented on June 11, 2024

@MasterB can you elaborate a bit more?

from stream-php.

MasterB avatar MasterB commented on June 11, 2024

@tbarbugli I've updated Guzzle from 5 to 6. Now its not possible to connect to my https - API, which has a Sneakoil certificate installed. I use PHP 5.5.x. Maybe there is a config problem with the server.

I've tried some things without success. Simple 'verify' => false no longer works for me.

http://docs.guzzlephp.org/en/latest/request-options.html#verify-option

I'm not an SSL certifacte expert.

from stream-php.

sabrinapisol avatar sabrinapisol commented on June 11, 2024

I've seen on the class GetStream\Stream\Feed that a new GuzzleHttp\Psr7\Request is made, and it has $this->guzzleOptions as fifth parameter.
Watching to the class GuzzleHttp\Psr7\Request I see that the constructor don't expects to receive that parameter there. And I think that because of that the method setGuzzleDefaultOption do nothing.

from stream-php.

hannesvdvreken avatar hannesvdvreken commented on June 11, 2024

@sabrinapisol You're right! I created this PR #45 which should fix that! It's probably a remainder of upgrading from Guzzle v4-5 to Guzzle v6.

I would be happy if you could take a look at that PR and tell me if you spot any mistakes.

from stream-php.

hannesvdvreken avatar hannesvdvreken commented on June 11, 2024

@MasterB also for you, #45 should fix that. Could you let me know if it works if you install it using

composer require get-stream/stream:"dev-fix/guzzle-request-options"

(please don't commit that, but only run it locally)

and then execute the usual

$feed->setGuzzleDefaultOption('verify', '/absolute/path/to/cacert.pem');
// or:
$feed->setGuzzleDefaultOption(GuzzleHttp\RequestOptions::VERIFY, '/absolute/path/to/cacert.pem');
// see: http://docs.guzzlephp.org/en/stable/request-options.html#verify

Thanks!

from stream-php.

hannesvdvreken avatar hannesvdvreken commented on June 11, 2024

@sabrinapisol @MasterB Replaced #45 with #49.

from stream-php.

hannesvdvreken avatar hannesvdvreken commented on June 11, 2024

Fixed in 2.4.1

from stream-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.