【发布时间】:2017-06-02 02:49:51
【问题描述】:
作为测试的一部分,我们正在尝试在我们的生产环境中设置 Docusign rest api。 通过我们的 staging 和其他测试服务器连接到 api 不需要特殊配置。但是,在我们的生产服务器上尝试相同的代码时,我一直遇到以下错误:
这是 sdk/docusign-php-client-master/src/ApiClient.php 第 227 行左右的输出 (api参考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**
关于 SSL 证书。我认为这可能是问题所在。它的报告方式与我们的其他服务器不同,后者将 CAfile 值留空。我无法弄清楚这是在哪里配置的。 只有 /etc/php5/apache2/php.ini 完全定义了文件位置。但是 php --ini 表明这不是用于配置 php 的 .ini 文件。删除设置似乎没有效果。它可能需要重新启动 apache2,但我没有机会关闭服务器。
字符串“etc/php5”也没有出现在代码库的任何地方,所以它不是手动设置的。 文件 /etc/php5/cacert.pem 存在并且是https://curl.haxx.se/ca/cacert.pem 的当前版本
如果我错了,请纠正我,但我无法手动设置“CAfile”的值,因为它似乎不是我可以访问的设置。
设置详情:
产品服务器:
SUSE Linux Enterprise Server 12 (x86_64)
PHP 5.5.14
cURL:
[version] => 7.37.0
[ssl_version] => OpenSSL/1.0.1i
暂存服务器:
登台服务器成功连接示例(部分)
* 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/
服务器详情:
openSUSE Leap 42.1 (x86_64)
PHP 5.5.14
cURL:
[version] => 7.37.0
[ssl_version] => OpenSSL/1.0.1i
【问题讨论】:
标签: apache ssl curl docusignapi suse