apache - 使用 Docusign API curl SSL 相关连接超时

标签 apache ssl curl docusignapi suse

作为测试的一部分,我们正在尝试在我们的生产环境中设置 Docusign rest api。 通过我们的暂存和其他测试服务器连接到 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

最佳答案

这很可能是客户端 SSL 证书的问题,而不是 DocuSign 服务器端的问题。我会研究以前有关 PHP 和 SSL 证书的相关问题,例如:

curl: (60) SSL certificate : unable to get local issuer certificate

您也可以尝试使用带有 -k 选项的 cUrl 来发送不安全的请求(用于测试)。 DocuSign 的演示环境还接受通过 http 而不是仅通过 https 的请求,因此您可能也想对其进行测试。

关于apache - 使用 Docusign API curl SSL 相关连接超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41707330/

相关文章:

php - 长轮询 PHP。是否保持数据库连接?

node.js - 我们需要 socket.io nodejs HTTPS OVER TLS 的 ssl 证书吗?

无法交叉编译(windows)链接ssl库的程序

google-chrome - 如何为 goa-cellar 项目创建 curl 请求或在 Postman(插件)中

ssl - cURL vs Postman,对 HTTPS POST 的不同响应

http - Lumen $request->all() 返回空数组

java - Apache 紧缩 : how to create custom counters

php - 使用 mod_rewrite 格式化 URL 参数

php - 我想使用 phpstorm IDE 作为服务器的远程控制

go - go - 如何使用证书存储中的证书并在 gin 框架中运行 TLS?