cURL error 60: Peer's Certificate issuer is not recognized.

I am using this php package ryanwinchester/hubspot-php in my php laravel v5 project.

It connects to hubspot and fetch deals. I have tested it and it works fine on my local machine. but when I pushed it to my production / live server ec2 instance [centos] running via apache. It throws this error:

cURL error 60: Peer's Certificate issuer is not recognized. (see http:\/\/curl.haxx.se\/libcurl\/c\/libcurl-errors.html)

with status code: 500 ..

can anyone please help me fix this issue?

thanks.

Hey @narainsagar ,

This is likely an issue with your certificate chain; I’ve included a stackoverflow article below that goes into more details, but the tl;dr is that you’ll want to make sure that your root Certificate Authority on your server is completely up to date. Here’s the SSL labs report on the HubSpot API domain showing that things are all set: SSL Server Test: api.hubapi.com (Powered by Qualys SSL Labs)

Hey @Derek_Gervais

Yes I have also run ssl analysis too and all seems to be fine. I also have verified certificate file paths in my php.ini file as well.

I have all other API endpoints running perfectly fine except this new written one for hubspot deals..

Hey @narainsagar ,

If that’s the case, can you give me your Hub ID & IP address, as well as a full example request & response body? Since SSL-related errors generally prevent the request from fully making it to our services, I’ll need to loop in my team to take a closer look.

Thanks for the reply.

This was some server certificate problem.

I recreated my server and setup ssl over it and it works fine now.

Thanks anyways,

Cheers,

Narain

Hey @narainsagar ,

No problem, thanks for coming back and posting your solution! I went ahead and marked your post as a solution so that this might help out other community members with similar issues. If you have any specific tips/tricks that helped you pin this issue down, feel free to update your post to include them!