Skip to content

Commit

Permalink
Fixed: CAPx Curl 60 error and new pem file
Browse files Browse the repository at this point in the history
  • Loading branch information
sherakama committed Mar 8, 2017
1 parent aadb720 commit f868a71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 6 additions & 3 deletions includes/CAPx/APILib/AbstractAPILib.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,14 @@ protected function makeRawRequest($endpoint, $params = array(), $extraOptions =
$options = array_merge($options, $extraOptions);
}

// This is bad idea. Need to find a better way to do this.
if (variable_get("stanford_capx_ignore_ssl", TRUE)) {
// Provide a default cert PEM.
$options['verify'] = drupal_get_path("module", "stanford_capx") . "/includes/CAPx/APILib/cacert.pem";

// This is bad idea. You should rely on the cert pem above.
if (variable_get("stanford_capx_ignore_ssl", FALSE)) {
$options['verify'] = FALSE;
}

// Build and make the request.
$response = FALSE;
try {
Expand Down
6 changes: 0 additions & 6 deletions includes/CAPx/APILib/HTTPClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class HTTPClient {
*/
public function __construct() {
$client = new GuzzleClient(['defaults' => ['auth' => 'oauth']]);
if (variable_get("stanford_capx_ignore_ssl", FALSE)) {
$client->setDefaultOption('verify', FALSE);
}
$this->setHttpClient($client);
}

Expand Down Expand Up @@ -85,9 +82,6 @@ public function getHttpClient() {

// If we do not have a client we need to create one.
$client = new GuzzleClient($this->getEndpoint());
if (variable_get("stanford_capx_ignore_ssl", FALSE)) {
$client->setDefaultOption('verify', FALSE);
}
$this->setHttpClient($client);

return $client;
Expand Down

0 comments on commit f868a71

Please sign in to comment.