您的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的開發人員控制面板中發佈按鍵/配置的屏幕截圖。 –