We are trying to setup Docusign rest api in our production environment as part of testing. Connection to the api via our staging and other test servers required no special configuration. However, when trying the same code on our production server I keep running into the following error:
This is output from around line 227 of sdk/docusign-php-client-master/src/ApiClient.php (api reference https://docs.docusign.com/esign/ )
[DEBUG] HTTP Request body ~BEGIN~
~END~
[DEBUG] HTTP Response body ~BEGIN~
~END~
* Hostname was NOT found in DNS cache
* Trying 162.248.184.25...
* Connected to demo.docusign.net (162.248.184.25) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /etc/php5/cacert.pem
CApath: /etc/ssl/certs/
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
Exception: exception 'DocuSign\eSign\ApiException' with message 'API call to https://demo.docusign.net/restapi/v2/login_information timed out: a:26:{s:3:"url";s:54:"https://demo.docusign.net/restapi/v2/login_information";s:12:"content_type";N;s:9:"http_code";i:0;s:11:"header_size";i:0;s:12:"request_size";i:0;s:8:"filetime";i:-1;s:17:"ssl_verify_result";i:1;s:14:"redirect_count";i:0;s:10:"total_time";d:0.67847199999999996;s:15:"namelookup_time";d:0.50941599999999998;s:12:"connect_time";d:0.59162199999999998;s:16:"pretransfer_time";d:0;s:11:"size_upload";d:0;s:13:"size_download";d:0;s:14:"speed_download";d:0;s:12:"speed_upload";d:0;s:23:"download_content_length";d:-1;s:21:"upload_content_length";d:-1;s:18:"starttransfer_time";d:0;s:13:"redirect_time";d:0;s:12:"redirect_url";s:0:"";s:10:"primary_ip";s:14:"162.248.184.25";s:8:"certinfo";a:0:{}s:12:"primary_port";i:443;s:8:"local_ip";s:14:"10.231.215.217";s:10:"local_port";i:38425;}' in /srv/www/vhosts/server.name.com/pages/test/docusign/sdk/docusign-php-client-master/src/ApiClient.php:233
Stack trace:
#0 /srv/www/vhosts/server.name.com/pages/test/docusign/sdk/docusign-php-client-master/src/Api/AuthenticationApi.php(264): DocuSign\eSign\ApiClient->callApi('/v2/login_infor...', 'GET', Array, '', Array, '\DocuSign\eSign...')
**#1 /srv/www/vhosts/server.name.com/pages/test/docusign/sdk/docusign-php-client-master/src/Api/AuthenticationApi.php(193): DocuSign\eSign\Api\AuthenticationApi->loginWithHttpInfo(Object(DocuSign\eSign\Api\AuthenticationApi\LoginOptions))
#2 /srv/www/vhosts/server.name.com/pages/test/docusign/docusign_wrapper.php(58): DocuSign\eSign\Api\AuthenticationApi->login(Object(DocuSign\eSign\Api\AuthenticationApi\LoginOptions))
#3 /srv/www/vhosts/server.name.com/pages/test/docusign/docusign_wrapper.php(52): DocuSignWrapper->doLogin()
#4 /srv/www/vhosts/server.name.com/pages/test/docusign/classtest.php(130): DocuSignWrapper->__construct()
#5**
As for the SSL certificate. I thought that might be the problem. It IS reporting differently than our other server which leaves the CAfile value blank. I cannot figure out where this is being configured. Only /etc/php5/apache2/php.ini has the file location defined at all. However php --ini reveals that this isn't an .ini file being used to configure php. Removal of the setting seems to have no effect. It may require an apache2 restart, but I have not had an opportunity to take the server down.
The string "etc/php5" also does not appear anywhere in the codebase so it isn't being set manually. The file, /etc/php5/cacert.pem exists and is a current version of https://curl.haxx.se/ca/cacert.pem
Correct me if I am wrong but I cannot manually set the value of "CAfile" as it is not a setting I seem to have access to.
Setup detail:
Prod Server:
SUSE Linux Enterprise Server 12 (x86_64)
PHP 5.5.14
cURL:
[version] => 7.37.0
[ssl_version] => OpenSSL/1.0.1i
Staging server:
Example of staging server successful connection (partial)
* Hostname was found in DNS cache
* Hostname in DNS cache was stale, zapped
* Trying 162.248.184.25...
* Connected to demo.docusign.net (162.248.184.25) port 443 (#2)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs/
server details:
openSUSE Leap 42.1 (x86_64)
PHP 5.5.14
cURL:
[version] => 7.37.0
[ssl_version] => OpenSSL/1.0.1i