Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert change "Set default use SSL to false" #280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Core/HttpClients/SyncRestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function sendRequest($requestParameters, $requestBody, $specifiedRequestU
* @param String $requestUri The Complete HTTP request URI
* @param RequestParameters$requestParameters The Complete HTTP request URI
* @param String $requestBody The request body for POST request.
* @param Boolean $throwExceptionOnError If throw an exception whent he return http status is not 200. Default is false
* @param Boolean $throwExceptionOnError If throw an exception when the return http status is not 200. Default is false
*
* @return array|null Response and HTTP Status code
*/
Expand All @@ -148,10 +148,10 @@ private function OAuth1APICall($baseURL, $queryParameters, $HttpMethod, $request
$httpHeaders = $this->setCommonHeadersForPHPSDK($AuthorizationHeader, $requestUri, $requestParameters->ContentType, $requestBody);
// Log Request Body to a file
$this->LogAPIRequestToLog($requestBody, $requestUri, $httpHeaders);
$intuitResponse = $this->httpClientInterface->makeAPICall($requestUri, $HttpMethod, $httpHeaders, $requestBody, null, false);
$intuitResponse = $this->httpClientInterface->makeAPICall($requestUri, $HttpMethod, $httpHeaders, $requestBody, null, true);
$faultHandler = $intuitResponse->getFaultHandler();
$this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
//Based on the ducomentation, the fetch expected HTTP/1.1 20X or a redirect. If not, any 3xx, 4xx or 5xx will throw an OAuth Exception
//Based on the documentation, the fetch expected HTTP/1.1 20X or a redirect. If not, any 3xx, 4xx or 5xx will throw an OAuth Exception
//for 3xx without direct, it will throw a 503 code and error saying: Invalid protected resource url, unable to generate signature base string
if($faultHandler) {
if($throwExceptionOnError == true){
Expand Down Expand Up @@ -195,7 +195,7 @@ private function getOAuth1AuthorizationHeader($baseURL, $queryParameters, $HttpM
* @param String $requestUri The Complete HTTP request URI
* @param RequestParameters$requestParameters The Complete HTTP request URI
* @param String $requestBody The request body for POST request.
* @param Boolean $throwExceptionOnError If throw an exception whent he return http status is not 200. Default is false
* @param Boolean $throwExceptionOnError If throw an exception when the return http status is not 200. Default is false
*
* @return array|null Response and HTTP Status code
*/
Expand All @@ -212,11 +212,11 @@ private function OAuth2APICall($baseURL, $queryParameters, $HttpMethod, $request
throw new SdkException("IPP or other Call is not supported in OAuth2 Mode.");
}

$intuitResponse = $this->httpClientInterface->makeAPICall($requestUri, $HttpMethod, $httpHeaders, $requestBody, null, false);
$intuitResponse = $this->httpClientInterface->makeAPICall($requestUri, $HttpMethod, $httpHeaders, $requestBody, null, true);
$faultHandler = $intuitResponse->getFaultHandler();
$this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());

//Based on the ducomentation, the fetch expected HTTP/1.1 20X or a redirect. If not, any 3xx, 4xx or 5xx will throw an OAuth Exception
//Based on the documentation, the fetch expected HTTP/1.1 20X or a redirect. If not, any 3xx, 4xx or 5xx will throw an OAuth Exception
//for 3xx without direct, it will throw a 503 code and error saying: Invalid protected resource url, unable to generate signature base string
if($faultHandler) {
if($throwExceptionOnError == true){
Expand Down