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

Fixes the turn_off_ssl_verification option so that it works with cURL. #123

Conversation

colinmccune
Copy link
Contributor

I noticed that the turn_off_ssl_verification option was no longer working in the latest version. I tracked the bug down with the switch to cURL. Under the hood it was directly using the value of turn_off_ssl_verification to set the cURL flag CURLOPT_SSL_VERIFYPEER but they actually have the opposite boolean meaning.

CURLOPT_SSL_VERIFYPEER

  • FALSE to stop cURL from verifying the peer's certificate. Alternate certificates to verify against can be specified with the CURLOPT_CAINFO option or a certificate directory can be specified with the CURLOPT_CAPATH option.

Reference: http://php.net/manual/en/function.curl-setopt.php (CURLOPT_SSL_VERIFYPEER)

@eddiezane eddiezane merged commit dbcdc89 into sendgrid:master Jan 29, 2015
@elbuo8
Copy link

elbuo8 commented Jan 29, 2015

Thanks for contributing to SendGrid Open Source! We think it's awesome when community members contribute to our projects and want to celebrate that.

The following link will ask you to authenticate with Github (so we can verify your identity), it will then ask for a little bit more information and we'll then send you a thanks for contributing.

Click Here to Continue »

Once again, thank you!

@eddiezane
Copy link
Contributor

Nice catch and thanks for fixing! Sorry for any trouble it caused you.

May I ask why this was necessary for you though?

@colinmccune
Copy link
Contributor Author

Hey Eddie,

I was doing some development on my local machine (OS X 10.8.5 / PHP 5.3.28) and came across the following error with the default turn_off_ssl_verification=false setting.

PHP Fatal error: Uncaught exception 'Exception' with message 'SSL certificate problem: self signed certificate in certificate chain' in /Users/.../vendor/sendgrid/sendgrid/lib/SendGrid.php:60

After some Googling it appears this error is likely due to the fact that I have some expired intermediate certificates in my system root keychain. Likely to be replaced by that OS X update/reboot I've been putting off :)

I was also going to investigate why the unit test isn't failing for this option on my machine but before I could do that I noticed test/SendGrid/Web.php isn't listed in phpunit.xml.dist. Do the Web.php tests need some work to get them back into shape? If so let me know and I could set aside some time to look at them.

colinmccune pushed a commit to colinmccune/patches that referenced this pull request Feb 3, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants