Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when making call from client to server #15

Closed
tn222eb opened this issue Apr 1, 2015 · 12 comments
Closed

Error when making call from client to server #15

tn222eb opened this issue Apr 1, 2015 · 12 comments
Assignees
Labels

Comments

@tn222eb
Copy link

tn222eb commented Apr 1, 2015

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 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 C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\Middleware.php(54): GuzzleHttp\Ring\Client\CurlHandler->__invoke(Array) #3 C:\workspace\app\vendor\guzzlehttp\ringphp\src\Client\Middleware.php(30): GuzzleHttp\Ring\Client\Middleware::GuzzleHttp\Ring\Client{closure}(Array) #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

@tbarbugli
Copy link
Member

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 notifications@github.com
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.

@tn222eb
Copy link
Author

tn222eb commented Apr 1, 2015

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 notifications@github.com:

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 notifications@github.com
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).

@davgothic
Copy link

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.

@tbarbugli
Copy link
Member

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 notifications@github.com
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).

@MasterB
Copy link

MasterB commented Jul 31, 2015

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

@tbarbugli
Copy link
Member

@MasterB can you elaborate a bit more?

@MasterB
Copy link

MasterB commented Aug 1, 2015

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

@sabrinapisol
Copy link

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.

@hannesvdvreken
Copy link
Contributor

hannesvdvreken commented Sep 20, 2017

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

@hannesvdvreken
Copy link
Contributor

@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!

@hannesvdvreken
Copy link
Contributor

@sabrinapisol @MasterB Replaced #45 with #49.

@hannesvdvreken
Copy link
Contributor

Fixed in 2.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants