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 in curl for LogglyHandler #899

Closed
BogMor opened this issue Dec 9, 2016 · 1 comment
Closed

Error in curl for LogglyHandler #899

BogMor opened this issue Dec 9, 2016 · 1 comment

Comments

@BogMor
Copy link

BogMor commented Dec 9, 2016

Is strange because this error wasn't before. The sending to Slack is working for the same message.

I'm using the handler LogglyHandler and on sending the log, I have the error:

"Curl error (code 60): SSL certificate problem: self signed certificate in certificate chain"

The error trace is below. Maybe the function "send" of "LogglyHandler" requires some SSL directives

    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2 );
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true );
    curl_setopt($ch, CURLOPT_TIMEOUT, 320);

#0 /mypath/Monolog/Handler/LogglyHandler.php(98): Monolog\Handler\Curl\Util::execute(Resource id #30)
#1 /mypath/Monolog/Handler/LogglyHandler.php(61): Monolog\Handler\LogglyHandler->send('{"message":"[Pr...', 'inputs')
#2 /mypath/Monolog/Handler/AbstractProcessingHandler.php(37): Monolog\Handler\LogglyHandler->write(Array)
#3 /mypath/Monolog/Logger.php(336): Monolog\Handler\AbstractProcessingHandler->handle(Array)
#4 /mypath/Monolog/Logger.php(587): Monolog\Logger->addRecord(300, '[Project "xyz...', Array)
#5 /mypath/framework/MyLogger.php(392): Monolog\Logger->warning('[Project "xyz...', Array)
#6 /mypath/framework/MyLogger.php(245): MyLogger::setMessage('usage', 'Email or passwo...', 'Response', 300, false)
#7 /mypath/index.php(71): MyLogger::setUsageMessage('Email or passwo...', 'Response', 300)
#8 {main}

@BogMor
Copy link
Author

BogMor commented Dec 9, 2016

After I clear the cache, the tests were without errors. So, I had in my cache the certificate for logs-01.loggly.com (host for Monolog) and one for loggly.com (login on site to see the results). I checked and aren't the same certificate.

My problem is now solved, but maybe is better to introduce the curl parameters
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1 );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true );
curl_setopt($ch, CURLOPT_TIMEOUT, 320);

Thank you.

@BogMor BogMor closed this as completed Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant