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

Issue when https not working correctly on server #8

Closed
tobya opened this issue Feb 27, 2013 · 1 comment
Closed

Issue when https not working correctly on server #8

tobya opened this issue Feb 27, 2013 · 1 comment

Comments

@tobya
Copy link
Contributor

tobya commented Feb 27, 2013

I just spent a while trying to track down a problem. I was just setting up a test to get mandrill-php working and when I tried a simple send test based on your messages_send.php example, I was getting a blank page. Switching on verbose I still got a blank page, but this in my apache log.

[Wed Feb 27 20:16:15 2013] [error] [client 127.0.0.1] MANDRILL: Invalid keys in call: 
[Wed Feb 27 20:16:15 2013] [error] [client 127.0.0.1] MANDRILL: Sending request to: https://mandrillapp.com/api/1.0/messages/send.json with data: {"message":{"html":"<h1>example html<\\/h1><a href='http:\\/\\/cookingisfun.ie'>alink <\\/a>","text":"example text","subject":"JFC Subject","from_email":"toby@jobsforcooks.com","from_name":"Toby Allen Jobs froc ookds","to":[{"email":"fontbother@gmail.com","name":"Toby Allen"}],"track_opens":true,"track_clicks":true,"auto_text":true,"url_strip_qs":true,"tags":["test","example","sample"]},"key":"IREMOVEDMYKEY"}

After quite a lot of digging and a few calls to curl_getinfo on the open session I finally figured out that there must be a problem with SSL from my dev machine. Once I changed the https to http in the mandrill api call it worked fine.

I appreciate how to set up SSL is another tutorial, but a check of the result object should be able to detect if the curl session actually happened.

I'll try to add some code to raise a helpful error and push a request.

@tobya
Copy link
Contributor Author

tobya commented Feb 27, 2013

I found that if the following is added before the curl session is exec

        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

then it works, however this trusts all server certificates, so should be an option the user has to set explicitly

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

2 participants