Recently I've been required to look at writing a Facebook application. I don't use Facebook and have little interest in it myself. I looked around for a quick start with Perl and Facebook and came across Facebook Authentication with Perl and Facebook::Graph which looked interesting to follow and work through.
Putting aside the problems I had getting something set up on our system that allowed Facebook to post back to us I was left with the error:
" core @0.919358> [hit #2]request to /facebook/postback/ crashed: Could not fetch access token: Can't connect to graph.facebook.com:443 (certificate verify failed) at /home/martin/perl5/lib/perl5/Facebook/Graph/AccessToken/Response.pm line 26 in /home/martin/perl5/lib/perl5/Dancer/Handler.pm l. 77"
What I could not understand about this is that the PHP FaceBook example from FaceBook worked fine. After much searching around I realised openssl was not accepting the HTTPS certificate for FaceBook and the PHP example included the certificates. I copied the certificates from the PHP example and put them into a "certs" file then a simple "export HTTPS_CA_FILE=/home/martin/certs" got it working.
Hope this helps anyone else following JT Smith's excellent article.