One thing that has got me in the past is fogetting to update the configuration host variable to include https, e.g. forgetting to change:
$host = 'http://www.yourserver.com';
$host = 'https://www.yourserver.com';
From memory I was getting the exact same error that you're experiencing.
FileMaker 12/11/10/9/8 Certified Developer
- - - - - - - - - - - - - - - - -
Phone: +61 2 9484 6565
Mobile: +61 418 468 103
Errmm....where would this be set at?
I typically have a site connection/config file that stores any settings for the particuarly FileMaker database I'm working with. It's what's used for the hostspec value when instantiating a FileMaker API connection.
If you're not setting this then have a look in the filemaker-api.php file - there's a line in there:
$__FM_CONFIG['hostspec'] = 'http://127.0.0.1';
change it to:
$__FM_CONFIG['hostspec'] = 'https://127.0.0.1';
or use the domain name for your SSL certificate:
$__FM_CONFIG['hostspec'] = 'https://www.yourserver.com';
and see if that makes a difference.
I made those changes as recommended in the filemaker-api.php file and it didn't appear to help. I changed the 'hostspec' setting to include 'https' but the PHP test still was failing.
I think that I figured out the solution. It was necessary to do two things, one of which was what you recommended above:
In the filemaker-api.php file located at: /Library/FileMaker Server/Web Publishing/publishing- engine/php/mountain lion/lib/php/FileMaker/conf :
1) Find this line: $__FM_CONFIG['hostspec'] = 'http://127.0.0.1';
change it to: $__FM_CONFIG['hostspec'] = 'https://127.0.0.1:443';
2) Uncomment this line of code:
$__FM_CONFIG['curlOptions'] = array(CURLOPT_SSL_VERIFYPEER => false);
As you noted, the line for #1 could also use your specific server name or IP, e.g. "10.10.1.45" or "www.myserver.com"; it doesn't have to be 127.0.0.1. Ours was a backup server, so didn't have the public-facing IP/name yet.
I believe that during deployment #1 will already be done for you IF you configured your server with SSL before doing your deployment, and you select "HTTPS" and "Port 443" during the deployment configuration. That is why I had to do that step manually in the file; I had NOT set it up for SSL when doing the initial deployment (because it wasn't set up yet).
Now...our problem appears to be performance/delays. The test-PHP file/connection takes 30+ seconds to return a result, even if you are accessing the page from a browser running on the server itself. That doesn't seem right.