From 49536c268839a5ae1d027c54d58740d5329517c7 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Wed, 11 Mar 2015 10:09:13 -0700 Subject: [PATCH 01/15] Adding smoke test to apply security group to port. --- tests/OpenCloud/Smoke/Unit/Networking.php | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/OpenCloud/Smoke/Unit/Networking.php b/tests/OpenCloud/Smoke/Unit/Networking.php index 8ccd30a94..02ed838bb 100644 --- a/tests/OpenCloud/Smoke/Unit/Networking.php +++ b/tests/OpenCloud/Smoke/Unit/Networking.php @@ -272,6 +272,30 @@ protected function testSecurityGroupOperations() $securityGroup = $this->getService()->getSecurityGroup($securityGroup->getId()); $this->stepInfo('Security Group ID: ' . $securityGroup->getId()); $this->stepInfo('Security Group Name: ' . $securityGroup->getName()); + + $network1 = $this->getService()->createNetwork(array( + 'name' => 'test_network_for_test_port_sg' + )); + $this->cleanupNetworkIds[] = $network1->getId(); + + $subnet1 = $this->getService()->createSubnet(array( + 'cidr' => '192.165.66.0/25', + 'networkId' => $network1->getId(), + 'ipVersion' => 4, + 'name' => 'test_subnet_for_test_port_sg' + )); + $this->cleanupSubnetIds[] = $subnet1->getId(); + + $port1 = $this->getService()->createPort(array( + 'networkId' => $network1->getId(), + 'name' => 'test_port_for_test_port_sg' + )); + $this->cleanupPortIds[] = $port1->getId(); + + $this->step('Apply security group to port'); + $port1->update(array( + 'securityGroups' => array($securityGroup->getId()) + )); } protected function testSecurityGroupRuleOperations() From ce882043affae1086789f9d6466d297fcb761534 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Wed, 11 Mar 2015 10:21:52 -0700 Subject: [PATCH 02/15] Minor formatting fix so code block renders correctly. --- doc/getting-started-with-rackspace.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/getting-started-with-rackspace.rst b/doc/getting-started-with-rackspace.rst index 35317a3e6..73aa3a8d4 100644 --- a/doc/getting-started-with-rackspace.rst +++ b/doc/getting-started-with-rackspace.rst @@ -138,7 +138,7 @@ Okay, you're ready to spin up a server: .. code-block:: php -use Guzzle\Http\Exception\BadResponseException; + use Guzzle\Http\Exception\BadResponseException; $server = $compute->server(); From 6e96119f1160c7a5457d19820a5d9e703bb3a059 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 08:21:50 -0700 Subject: [PATCH 03/15] Using TLSv1 cipher suite for Cloud Databases client. --- lib/OpenCloud/Database/Service.php | 22 +++++++++++++++++++ .../OpenCloud/Tests/Database/ServiceTest.php | 7 ++++++ 2 files changed, 29 insertions(+) diff --git a/lib/OpenCloud/Database/Service.php b/lib/OpenCloud/Database/Service.php index dd63a60f1..50845ba24 100644 --- a/lib/OpenCloud/Database/Service.php +++ b/lib/OpenCloud/Database/Service.php @@ -17,6 +17,8 @@ namespace OpenCloud\Database; +use Guzzle\Http\ClientInterface; +use Psr\Log\LogLevel; use OpenCloud\Common\Service\NovaService; use OpenCloud\Database\Resource\Instance; use OpenCloud\Database\Resource\Configuration; @@ -104,4 +106,24 @@ public function datastoreList($params = array()) return $this->resourceList('Datastore', $url); } + + /** + * {@inheritDoc} + */ + public function setClient(ClientInterface $client) + { + // The Rackspace Cloud Databases service only supports the + // RC4 SSL cipher which is not supported by modern OpenSSL clients. + // Until the service can support additional, more modern and secure + // ciphers, this SDK has to ask curl to allow using the weaker + // cipher. For more information, see https://github.com/rackspace/php-opencloud/issues/560 + + $curlOptions = $client->getConfig()->get('curl.options'); + $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = CURL_SSLVERSION_TLSv1; + $client->getConfig()->set('curl.options', $curlOptions); + + $client->getLogger()->critical('The SDK is using the TLSv1 cipher suite when connecting to the Rackspace Cloud Databases service. This suite contains a weak cipher (RC4) so please use at your own risk. See https://github.com/rackspace/php-opencloud/issues/560 for details.'); + + $this->client = $client; + } } diff --git a/tests/OpenCloud/Tests/Database/ServiceTest.php b/tests/OpenCloud/Tests/Database/ServiceTest.php index 8212fb61a..4c690ae81 100644 --- a/tests/OpenCloud/Tests/Database/ServiceTest.php +++ b/tests/OpenCloud/Tests/Database/ServiceTest.php @@ -71,4 +71,11 @@ public function testDatastoreList() { $this->assertInstanceOf(self::COLLECTION_CLASS, $this->service->datastoreList()); } + + public function testClientUsesTLSv1CipherSuite() + { + $client = $this->service->getClient(); + $curlOptions = $client->getConfig('curl.options'); + $this->assertEquals(CURL_SSLVERSION_TLSv1, $curlOptions['CURLOPT_SSL_CIPHER_LIST']); + } } From 488a69d8aebdb0a9a2350f7b7919e9a70e0afef1 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 08:40:04 -0700 Subject: [PATCH 04/15] Check that critical message is being logged + suppress log output. --- .../Tests/Database/DatabaseTestCase.php | 25 ++++++++++++++++++- .../OpenCloud/Tests/Database/ServiceTest.php | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/OpenCloud/Tests/Database/DatabaseTestCase.php b/tests/OpenCloud/Tests/Database/DatabaseTestCase.php index 0e8ad75cb..c0a0b38e0 100644 --- a/tests/OpenCloud/Tests/Database/DatabaseTestCase.php +++ b/tests/OpenCloud/Tests/Database/DatabaseTestCase.php @@ -18,6 +18,22 @@ namespace OpenCloud\Tests\Database; use OpenCloud\Tests\OpenCloudTestCase; +use OpenCloud\Common\Log\Logger; + +class UnitTestLogger extends Logger +{ + protected $criticalLogMessage; + + public function critical($message, array $context = array()) + { + ++$this->criticalLogMessage; + } + + public function getCriticalLogMessage() + { + return $this->criticalLogMessage; + } +} class DatabaseTestCase extends OpenCloudTestCase { @@ -28,7 +44,9 @@ class DatabaseTestCase extends OpenCloudTestCase public function setupObjects() { - $this->service = $this->getClient()->databaseService(); + $client = $this->getClient(); + $client->setLogger(new UnitTestLogger()); + $this->service = $client->databaseService(); $this->addMockSubscriber($this->getTestFilePath('Instance')); $this->instance = $this->service->instance('foo'); @@ -37,4 +55,9 @@ public function setupObjects() $this->datastore = $this->service->datastore('10000000-0000-0000-0000-000000000001'); $this->datastoreVersion = $this->datastore->version('b00000b0-00b0-0b00-00b0-000b000000bb'); } + + protected function assertCriticalMessageWasLogged() + { + $this->assertNotEmpty($this->getClient()->getLogger()->getCriticalLogMessage()); + } } diff --git a/tests/OpenCloud/Tests/Database/ServiceTest.php b/tests/OpenCloud/Tests/Database/ServiceTest.php index 4c690ae81..3dc5a11f1 100644 --- a/tests/OpenCloud/Tests/Database/ServiceTest.php +++ b/tests/OpenCloud/Tests/Database/ServiceTest.php @@ -77,5 +77,6 @@ public function testClientUsesTLSv1CipherSuite() $client = $this->service->getClient(); $curlOptions = $client->getConfig('curl.options'); $this->assertEquals(CURL_SSLVERSION_TLSv1, $curlOptions['CURLOPT_SSL_CIPHER_LIST']); + $this->assertCriticalMessageWasLogged(); } } From e7f8dc4be23fc568f13c5e02bb518ac1b7992aa4 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 08:49:39 -0700 Subject: [PATCH 05/15] Removing unnecessary import. --- lib/OpenCloud/Database/Service.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/OpenCloud/Database/Service.php b/lib/OpenCloud/Database/Service.php index 50845ba24..2e9d56093 100644 --- a/lib/OpenCloud/Database/Service.php +++ b/lib/OpenCloud/Database/Service.php @@ -18,7 +18,6 @@ namespace OpenCloud\Database; use Guzzle\Http\ClientInterface; -use Psr\Log\LogLevel; use OpenCloud\Common\Service\NovaService; use OpenCloud\Database\Resource\Instance; use OpenCloud\Database\Resource\Configuration; From 2295b6b111905cd0a2bfc2ef190eda0f730d3ecf Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 08:49:46 -0700 Subject: [PATCH 06/15] Breaking up log message over several lines. --- lib/OpenCloud/Database/Service.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/OpenCloud/Database/Service.php b/lib/OpenCloud/Database/Service.php index 2e9d56093..00498ed28 100644 --- a/lib/OpenCloud/Database/Service.php +++ b/lib/OpenCloud/Database/Service.php @@ -121,7 +121,11 @@ public function setClient(ClientInterface $client) $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = CURL_SSLVERSION_TLSv1; $client->getConfig()->set('curl.options', $curlOptions); - $client->getLogger()->critical('The SDK is using the TLSv1 cipher suite when connecting to the Rackspace Cloud Databases service. This suite contains a weak cipher (RC4) so please use at your own risk. See https://github.com/rackspace/php-opencloud/issues/560 for details.'); + $logMessage = 'The SDK is using the TLSv1 cipher suite when connecting ' + . 'to the Rackspace Cloud Databases service. This suite contains ' + . 'a weak cipher (RC4) so please use at your own risk. See ' + . 'https://github.com/rackspace/php-opencloud/issues/560 for details.'; + $client->getLogger()->critical($logMessage); $this->client = $client; } From 8bccc6be0ea8807d0348c2a6a65695ea6dff1013 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 08:54:37 -0700 Subject: [PATCH 07/15] Fixing option value - should be cipher name not integer (constant). --- lib/OpenCloud/Database/Service.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenCloud/Database/Service.php b/lib/OpenCloud/Database/Service.php index 00498ed28..b73ee2f7c 100644 --- a/lib/OpenCloud/Database/Service.php +++ b/lib/OpenCloud/Database/Service.php @@ -118,7 +118,7 @@ public function setClient(ClientInterface $client) // cipher. For more information, see https://github.com/rackspace/php-opencloud/issues/560 $curlOptions = $client->getConfig()->get('curl.options'); - $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = CURL_SSLVERSION_TLSv1; + $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = 'TLSv1'; $client->getConfig()->set('curl.options', $curlOptions); $logMessage = 'The SDK is using the TLSv1 cipher suite when connecting ' From e07ff1598a465f72a4ccb8f34f0d712dbb0a3123 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 09:50:56 -0700 Subject: [PATCH 08/15] Use custom cipher suite stronger than TLSv1 (but still including RC4 for Cloud Databases). --- lib/OpenCloud/Database/Service.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/OpenCloud/Database/Service.php b/lib/OpenCloud/Database/Service.php index b73ee2f7c..065191095 100644 --- a/lib/OpenCloud/Database/Service.php +++ b/lib/OpenCloud/Database/Service.php @@ -118,7 +118,10 @@ public function setClient(ClientInterface $client) // cipher. For more information, see https://github.com/rackspace/php-opencloud/issues/560 $curlOptions = $client->getConfig()->get('curl.options'); - $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = 'TLSv1'; + $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:' + . 'ECDH+AES128:DH+AES:ECDH+HIGH:DH+HIGH:ECDH+3DES:' + . 'DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:' + . 'ECDH+RC4:DH+RC4:RSA+RC4:!aNULL:!eNULL:!MD5'; $client->getConfig()->set('curl.options', $curlOptions); $logMessage = 'The SDK is using the TLSv1 cipher suite when connecting ' From 78f36450367307fef800d640f4cf5fa1c6ddad98 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 10:08:35 -0700 Subject: [PATCH 09/15] Refactoring SSL cipher list into constant; fixing test. --- lib/OpenCloud/Database/Service.php | 10 ++++++---- tests/OpenCloud/Tests/Database/ServiceTest.php | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/OpenCloud/Database/Service.php b/lib/OpenCloud/Database/Service.php index 065191095..0828d47f1 100644 --- a/lib/OpenCloud/Database/Service.php +++ b/lib/OpenCloud/Database/Service.php @@ -31,6 +31,11 @@ class Service extends NovaService const DEFAULT_TYPE = 'rax:database'; const DEFAULT_NAME = 'cloudDatabases'; + const SSL_CIPHER_LIST = 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:' + . 'ECDH+AES128:DH+AES:ECDH+HIGH:DH+HIGH:ECDH+3DES:' + . 'DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:' + . 'ECDH+RC4:DH+RC4:RSA+RC4:!aNULL:!eNULL:!MD5'; + /** * Returns an Instance * @@ -118,10 +123,7 @@ public function setClient(ClientInterface $client) // cipher. For more information, see https://github.com/rackspace/php-opencloud/issues/560 $curlOptions = $client->getConfig()->get('curl.options'); - $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:' - . 'ECDH+AES128:DH+AES:ECDH+HIGH:DH+HIGH:ECDH+3DES:' - . 'DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:' - . 'ECDH+RC4:DH+RC4:RSA+RC4:!aNULL:!eNULL:!MD5'; + $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = self::SSL_CIPHER_LIST; $client->getConfig()->set('curl.options', $curlOptions); $logMessage = 'The SDK is using the TLSv1 cipher suite when connecting ' diff --git a/tests/OpenCloud/Tests/Database/ServiceTest.php b/tests/OpenCloud/Tests/Database/ServiceTest.php index 3dc5a11f1..28636a363 100644 --- a/tests/OpenCloud/Tests/Database/ServiceTest.php +++ b/tests/OpenCloud/Tests/Database/ServiceTest.php @@ -27,6 +27,8 @@ namespace OpenCloud\Tests\Database; +use OpenCloud\Database\Service; + class ServiceTest extends DatabaseTestCase { public function test__construct() @@ -76,7 +78,7 @@ public function testClientUsesTLSv1CipherSuite() { $client = $this->service->getClient(); $curlOptions = $client->getConfig('curl.options'); - $this->assertEquals(CURL_SSLVERSION_TLSv1, $curlOptions['CURLOPT_SSL_CIPHER_LIST']); + $this->assertEquals(Service::SSL_CIPHER_LIST, $curlOptions['CURLOPT_SSL_CIPHER_LIST']); $this->assertCriticalMessageWasLogged(); } } From 64e643070da51a2e40507ed1477e97b1b5ba15bf Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 10:16:20 -0700 Subject: [PATCH 10/15] PHP < 5.6 does not like multi-line consts :| --- lib/OpenCloud/Database/Service.php | 15 +++++++++------ tests/OpenCloud/Tests/Database/ServiceTest.php | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/OpenCloud/Database/Service.php b/lib/OpenCloud/Database/Service.php index 0828d47f1..1098e6add 100644 --- a/lib/OpenCloud/Database/Service.php +++ b/lib/OpenCloud/Database/Service.php @@ -31,11 +31,6 @@ class Service extends NovaService const DEFAULT_TYPE = 'rax:database'; const DEFAULT_NAME = 'cloudDatabases'; - const SSL_CIPHER_LIST = 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:' - . 'ECDH+AES128:DH+AES:ECDH+HIGH:DH+HIGH:ECDH+3DES:' - . 'DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:' - . 'ECDH+RC4:DH+RC4:RSA+RC4:!aNULL:!eNULL:!MD5'; - /** * Returns an Instance * @@ -123,7 +118,7 @@ public function setClient(ClientInterface $client) // cipher. For more information, see https://github.com/rackspace/php-opencloud/issues/560 $curlOptions = $client->getConfig()->get('curl.options'); - $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = self::SSL_CIPHER_LIST; + $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = static::getSslCipherList(); $client->getConfig()->set('curl.options', $curlOptions); $logMessage = 'The SDK is using the TLSv1 cipher suite when connecting ' @@ -134,4 +129,12 @@ public function setClient(ClientInterface $client) $this->client = $client; } + + public static function getSslCipherList() + { + return 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:' + . 'ECDH+AES128:DH+AES:ECDH+HIGH:DH+HIGH:ECDH+3DES:' + . 'DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:' + . 'ECDH+RC4:DH+RC4:RSA+RC4:!aNULL:!eNULL:!MD5'; + } } diff --git a/tests/OpenCloud/Tests/Database/ServiceTest.php b/tests/OpenCloud/Tests/Database/ServiceTest.php index 28636a363..a3f5f4401 100644 --- a/tests/OpenCloud/Tests/Database/ServiceTest.php +++ b/tests/OpenCloud/Tests/Database/ServiceTest.php @@ -78,7 +78,7 @@ public function testClientUsesTLSv1CipherSuite() { $client = $this->service->getClient(); $curlOptions = $client->getConfig('curl.options'); - $this->assertEquals(Service::SSL_CIPHER_LIST, $curlOptions['CURLOPT_SSL_CIPHER_LIST']); + $this->assertEquals(Service::getSslCipherList(), $curlOptions['CURLOPT_SSL_CIPHER_LIST']); $this->assertCriticalMessageWasLogged(); } } From d4ff6f4c9dcee0d0b1051d637f1088ee181e0c68 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 10:18:45 -0700 Subject: [PATCH 11/15] Fixing log message to match reality. --- lib/OpenCloud/Database/Service.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpenCloud/Database/Service.php b/lib/OpenCloud/Database/Service.php index 1098e6add..58c5ba260 100644 --- a/lib/OpenCloud/Database/Service.php +++ b/lib/OpenCloud/Database/Service.php @@ -121,7 +121,7 @@ public function setClient(ClientInterface $client) $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = static::getSslCipherList(); $client->getConfig()->set('curl.options', $curlOptions); - $logMessage = 'The SDK is using the TLSv1 cipher suite when connecting ' + $logMessage = 'The SDK is using a custom cipher suite when connecting ' . 'to the Rackspace Cloud Databases service. This suite contains ' . 'a weak cipher (RC4) so please use at your own risk. See ' . 'https://github.com/rackspace/php-opencloud/issues/560 for details.'; From f7eecae377c17423c8bb790bfb92d0631eddedda Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 10:20:01 -0700 Subject: [PATCH 12/15] Fixing unit test method name to match reality. --- tests/OpenCloud/Tests/Database/ServiceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/OpenCloud/Tests/Database/ServiceTest.php b/tests/OpenCloud/Tests/Database/ServiceTest.php index a3f5f4401..96a6be1c6 100644 --- a/tests/OpenCloud/Tests/Database/ServiceTest.php +++ b/tests/OpenCloud/Tests/Database/ServiceTest.php @@ -74,7 +74,7 @@ public function testDatastoreList() $this->assertInstanceOf(self::COLLECTION_CLASS, $this->service->datastoreList()); } - public function testClientUsesTLSv1CipherSuite() + public function testClientUsesCustomCipherSuite() { $client = $this->service->getClient(); $curlOptions = $client->getConfig('curl.options'); From b9279e3fd5d97cb60981528866f2f03ab1906329 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 10:29:50 -0700 Subject: [PATCH 13/15] Refactoring logger into common class to enable reuse. --- .../Tests/Database/DatabaseTestCase.php | 19 ++-------- tests/OpenCloud/Tests/MockLogger.php | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 tests/OpenCloud/Tests/MockLogger.php diff --git a/tests/OpenCloud/Tests/Database/DatabaseTestCase.php b/tests/OpenCloud/Tests/Database/DatabaseTestCase.php index c0a0b38e0..403f6955f 100644 --- a/tests/OpenCloud/Tests/Database/DatabaseTestCase.php +++ b/tests/OpenCloud/Tests/Database/DatabaseTestCase.php @@ -18,22 +18,7 @@ namespace OpenCloud\Tests\Database; use OpenCloud\Tests\OpenCloudTestCase; -use OpenCloud\Common\Log\Logger; - -class UnitTestLogger extends Logger -{ - protected $criticalLogMessage; - - public function critical($message, array $context = array()) - { - ++$this->criticalLogMessage; - } - - public function getCriticalLogMessage() - { - return $this->criticalLogMessage; - } -} +use OpenCloud\Tests\MockLogger; class DatabaseTestCase extends OpenCloudTestCase { @@ -45,7 +30,7 @@ class DatabaseTestCase extends OpenCloudTestCase public function setupObjects() { $client = $this->getClient(); - $client->setLogger(new UnitTestLogger()); + $client->setLogger(new MockLogger()); $this->service = $client->databaseService(); $this->addMockSubscriber($this->getTestFilePath('Instance')); diff --git a/tests/OpenCloud/Tests/MockLogger.php b/tests/OpenCloud/Tests/MockLogger.php new file mode 100644 index 000000000..9aca3dd68 --- /dev/null +++ b/tests/OpenCloud/Tests/MockLogger.php @@ -0,0 +1,35 @@ +criticalLogMessage; + } + + public function getCriticalLogMessage() + { + return $this->criticalLogMessage; + } +} From 6d133a314af596395e9721965eb9990ab45dde73 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 10:30:04 -0700 Subject: [PATCH 14/15] Use mock logger for database service test to supress log output. --- tests/OpenCloud/Tests/RackspaceTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/OpenCloud/Tests/RackspaceTest.php b/tests/OpenCloud/Tests/RackspaceTest.php index 790d54645..7cf37f183 100644 --- a/tests/OpenCloud/Tests/RackspaceTest.php +++ b/tests/OpenCloud/Tests/RackspaceTest.php @@ -17,6 +17,8 @@ namespace OpenCloud\Tests; +use OpenCloud\Tests\MockLogger; + class RackspaceTest extends OpenCloudTestCase { const CREDENTIALS = <<getClient()->getLogger(); + $this->getClient()->setLogger(new MockLogger()); + $this->assertInstanceOf( 'OpenCloud\Database\Service', $this->getClient()->databaseService('cloudDatabases', 'DFW') ); + + // Re-inject old logger + $this->getClient()->setLogger($oldLogger); + $this->assertInstanceOf( 'OpenCloud\LoadBalancer\Service', $this->getClient()->loadBalancerService('cloudLoadBalancers', 'DFW') From a1eb1e09778ab8e5e35a880304c88d87d97325ef Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 16 Mar 2015 12:06:59 -0700 Subject: [PATCH 15/15] Adding reference to cipher list comment in docblock. --- lib/OpenCloud/Database/Service.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/OpenCloud/Database/Service.php b/lib/OpenCloud/Database/Service.php index 58c5ba260..de20872b6 100644 --- a/lib/OpenCloud/Database/Service.php +++ b/lib/OpenCloud/Database/Service.php @@ -130,6 +130,9 @@ public function setClient(ClientInterface $client) $this->client = $client; } + /** + * @see https://github.com/rackspace/php-opencloud/issues/560#issuecomment-81790778 + */ public static function getSslCipherList() { return 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:'