Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 9 additions & 1 deletion BigCommerce/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ public static function verifyPeer($option=false)
self::connection()->verifyPeer($option);
}

/**
* Set which cipher to use during SSL requests.
*/
public static function setCipher($cipher='RC4-SHA')
{
self::connection()->setCipher($cipher);
}

/**
* Connect to the internet through a proxy server.
*
Expand Down Expand Up @@ -684,4 +692,4 @@ public static function getRequestsRemaining()
return intval($limit);
}

}
}
11 changes: 10 additions & 1 deletion BigCommerce/Api/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ public function verifyPeer($option=false)
curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, $option);
}

/**
* Set which cipher to use during SSL requests.
* @param string $cipher the name of the cipher
*/
public function setCipher($cipher='RC4-SHA')
{
curl_setopt($this->curl, CURLOPT_SSL_CIPHER_LIST, $cipher);
}

/**
* Add a custom header to the request.
*/
Expand Down Expand Up @@ -487,4 +496,4 @@ public function __toString()
class BigCommerce_Api_ServerError extends BigCommerce_Api_Error
{

}
}
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,18 @@ The exceptions thrown are subclasses of BigCommerce_Api_Error, representing
client errors and server errors. The API documentation for response codes
contains a list of all the possible error conditions the client may encounter.

Specifying the SSL cipher
-------------------------

The API requires that all client SSL connections use the rsa_rc4_128_sha cipher.
This should not be an issue as curl will use this by default. In those
situations where this is not the case the you will need to use the setCipher
method to force curl to use the correct cipher.

```
BigCommerce_Api::setCipher('RC4-SHA');
```

Verifying SSL certificates
--------------------------

Expand Down