Friday, 12 April 2013

Panjit G

Today I was mostly doing more website work.

I had an issue with getting PDT data from paypal when using cURL, the problem being that the SSL certificate was not trusted. The paypal docs said about using curl_setopt to add the location of cacert.pem using the CURLOPT_CAINFO field, but do not say where to get cacert.pem from.

A bit of googling found this article: Using cURL in PHP to access HTTPS (SSL/TLS) protected sites. However it didn't work for me. I tried saving all 3 levels of the SSL certificate on and tried both X.509 Certificate (PEM) and X.509 Certificate with chain (PEM) options when saving, but none of them would work.

I then found this post on stackoverflow: SSL certificate issue: unable to get local issuer certificate on payapl ipn verification. The answer given there is:

If you don't have an up-to-date cacert list yourself, I'd recommend downloading the one supplied by the cURL maintainer(s) himself: cacert.pem.

I did that, and now I could connect to the paypal sandbox okay and retrieve the PDT data.

Clamps for my home-made plamp arrived today, so I made a plamp. It is definitely not as good as my real plamp as the wire bends too easily and is tricky to get it to stay where you want it. But it might be useful.

I also prepared my pog website update today.

No comments: