您的cURL PHP扩展似乎配置错误。如果您发现,当您尝试使用卷曲TLS/SSL的网站访问,你会得到这样的东西:
Trying to hit URL: https://oauth.intuit.com/oauth/v1/get_request_token
Did we disable SSL checks? false
* Hostname oauth.intuit.com was found in DNS cache
* Trying 173.240.170.25...
* TCP_NODELAY set
* Connected to oauth.intuit.com (173.240.170.25) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* SSL certificate problem: self signed certificate in certificate chain
* Curl_http_done: called premature == 1
* Closing connection 0
通知连接被越来越立即关闭,任何实际数据交换之前。
与此相比,结果当TLS/SSL验证被明确禁用:
Trying to hit URL: https://oauth.intuit.com/oauth/v1/get_request_token
Did we disable SSL checks? true
* Hostname oauth.intuit.com was found in DNS cache
* Trying 173.240.170.25...
* TCP_NODELAY set
* Connected to oauth.intuit.com (173.240.170.25) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* SSL connection using TLSv1.2/AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: C=US; ST=California; L=San Diego; O=INTUIT INC.; OU=CTO-DEV-ICS-OAuth1; CN=oauth.intuit.net
* start date: Sep 9 00:00:00 2016 GMT
* expire date: Sep 10 23:59:59 2019 GMT
* issuer: C=US; O=Symantec Corporation; OU=Symantec Trust Network; CN=Symantec Class 3 Secure Server CA - G4
* SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.
> GET /oauth/v1/get_request_token HTTP/1.1
Host: oauth.intuit.com
Accept: */*
< HTTP/1.1 400 Bad Request
< Content-Type: text/plain
< Content-Length: 70
< Connection: keep-alive
< Date: Tue, 28 Mar 2017 02:34:14 GMT
< Server: Apache
< WWW-Authenticate: OAuth oauth_parameters_absent="oauth_signature", oauth_problem="parameter_absent"
< Cache-Control: no-cache, no-store
< Pragma: no-cache
<
* Curl_http_done: called premature == 0
* Connection #0 to host oauth.intuit.com left intact
oauth_problem=parameter_absent&oauth_parameters_absent=oauth_signature
注意,现在它工作。
这告诉我这里可能存在的问题是您的cURL PHP扩展程序不知道如何进行TLS请求。这是cURL和PHP的一个常见问题。
如果你搜索谷歌或StackOverflow的这样的事情:
“PHP卷曲不使用HTTPS工作”你会发现很多的答案,说明如何处理这个的,沿有关此信任存储中科院官方卷曲声明:
也请看看,并确认该PHP卷曲配置变量的正确配置:
参考这样的:
发表您的码。在Intuit的开发人员控制面板中发布按键/配置的屏幕截图。没有这些细节,我们无法帮助你。 –
完整的代码就像从QuickBooks PHP DevKit的Github下载,除了'.. \ example_app_ipp_v3 \ config.php'文件。我已经用上面的值改变了config.php变量。我从Intuit开发人员门户网站获得了这个:https://ibb.co/f6tgov如果我在Apache服务器上托管Devkit示例,这个相同的密钥可以工作。 我应该上传修改过的config.php文件吗?谢谢@KeithPalmerJr。 –
在Intuit的开发人员控制面板中发布按键/配置的屏幕截图。 –