Skip to content

Commit

Permalink
CIVIQBO-67 Revert change "Set default use SSL to false"
Browse files Browse the repository at this point in the history
  • Loading branch information
agileware-justin committed Oct 12, 2023
1 parent a4039a8 commit 2d19800
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 2d19800

Please sign in to comment.