Acquia Dev Desktop, PHP 5.6 and SSL certificate issue on local MacOSX I am having problems authenticating to SalesForce using the Drupal SalesForce Suite module https://www.drupal.org/project/salesforce

Error opening socket ssl://ap2.salesforce.com:443

I am running Drupal using DevDesktop 2 (Built: Nov 22 2015 12:34:41) on my local MacOSX machine with PHP 5.6 with SSL turned on. On a Ubuntu server I can get the salesforce module to authenticate without an issue using the exact same settings as what I have on the Mac.
When I run this additional test on the Mac I get a similar error:
fsockopen('ssl://google.com',443,$errno,$errstr) ? print(&quot;UP&quot;) : print(&quot;DOWN:&quot;.$errstr);


Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in test.php on line 2
Warning: fsockopen(): Failed to enable crypto in test.php on line 2
Warning: fsockopen(): unable to connect to ssl://google.com:443 (Unknown error) in test.php on line 2
DOWN:

When I view phpinfo() I can see that the setting for &quot;Openssl default config&quot; is  /Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl/openssl.cnf
This version of Dev Desktop is supposed to support SSL for local development. From the DevDesktop documentation:
https://docs.acquia.com/dev-desktop/sites#https

Using HTTPS (SSL) with local sites
The Local site URL link for local websites provides a Use https check box. When you select the Use https check box, Acquia Dev Desktop serves your site using the HTTPS protocol and uses a self-signed SSL certificate to simulate secure traffic. This enables you to develop and test secure websites locally without requiring you to duplicate the SSL certificates you use on your production site.

Has anyone encountered this before and how do we get DevDesktop to point to the self-signed SSL certificate that is mentioned?
After looking around I found kenorb's reply on a similar issue:
https://drupal.stackexchange.com/a/149456/62500

and after poking around the DevDesktop installed files on my Mac I managed to solve it.

The problem is the certificate file does not exist at the default location. 

print_r(openssl_get_cert_locations());


Returns

Array ( 
    [default_cert_file] =&gt; /Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl/cert.pem 
    [default_cert_file_env] =&gt; SSL_CERT_FILE 
    [default_cert_dir] =&gt; /Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl/certs 
    [default_cert_dir_env] =&gt; SSL_CERT_DIR 
    [default_private_dir] =&gt; /Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl/private 
    [default_default_cert_area] =&gt; /Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl 
    [ini_cafile] =&gt; [ini_capath] =&gt; ) 


So it is looking for cert.pem in the non existent directory "/Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl/"

To solve this, edit /Applications/[Dev desktop folder]/php5_6/bin/php.ini

and add these lines:

[openssl]
openssl.cafile="/Applications/[Dev desktop folder]/common/cert/cacert.pem"
openssl.capath="/Applications/[Dev desktop folder]/common/cert/"


where is [Dev desktop folder] is the name of your Dev Desktop folder.