1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 02:22:57 +01:00

Explicitly setting curl SSL options rather than relying on the defaults (which do the same as the settings I added). Updating some docblocks

This commit is contained in:
Michael Dowling 2012-09-22 14:35:06 -07:00
parent 3622ed264e
commit a8836a1011
4 changed files with 15 additions and 19 deletions

View File

@ -68,7 +68,11 @@ class CurlHandle
CURLOPT_HTTPHEADER => array(),
CURLOPT_HEADERFUNCTION => array($mediator, 'receiveResponseHeader'),
CURLOPT_HTTP_VERSION => $request->getProtocolVersion() === '1.0'
? CURL_HTTP_VERSION_1_0 : CURL_HTTP_VERSION_1_1
? CURL_HTTP_VERSION_1_0 : CURL_HTTP_VERSION_1_1,
// Verifies the authenticity of the peer's certificate
CURLOPT_SSL_VERIFYPEER => 1,
// Certificate must indicate that the server is the server to which you meant to connect
CURLOPT_SSL_VERIFYHOST => 2
);
// Enable the progress function if the 'progress' param was set

View File

@ -91,13 +91,7 @@ class ServiceBuilder extends AbstractHasDispatcher implements ServiceBuilderInte
}
/**
* Get a client using a registered builder
*
* @param string $name Name of the registered client to retrieve
* @param bool $throwAway Set to TRUE to not store the client for later retrieval from the ServiceBuilder
*
* @return ClientInterface
* @throws ServiceNotFoundException when a client cannot be found by name
* {@inheritdoc}
*/
public function get($name, $throwAway = false)
{
@ -132,12 +126,7 @@ class ServiceBuilder extends AbstractHasDispatcher implements ServiceBuilderInte
}
/**
* Register a client by name with the service builder
*
* @param string $key Name of the client to register
* @param mixed $service Service to register
*
* @return ServiceBuilderInterface
* {@inheritdoc}
*/
public function set($key, $service)
{

View File

@ -24,8 +24,8 @@ interface ServiceBuilderInterface
/**
* Register a client by name with the service builder
*
* @param string $name Name of the client to register
* @param mixed $value Service to register
* @param string $key Name of the client to register
* @param mixed $service Service to register
*
* @return ServiceBuilderInterface
*/

View File

@ -10,6 +10,7 @@ use Guzzle\Http\Message\HeaderComparison;
use Guzzle\Plugin\Mock\MockPlugin;
use Guzzle\Service\Client;
use Guzzle\Service\Builder\ServiceBuilderInterface;
use Guzzle\Service\Builder\ServiceBuilder;
use Guzzle\Tests\Mock\MockObserver;
use Guzzle\Tests\Http\Server;
use RuntimeException;
@ -53,7 +54,7 @@ abstract class GuzzleTestCase extends \PHPUnit_Framework_TestCase
/**
* Set the service builder to use for tests
*
* @param ServiceBuilder $builder Service builder
* @param ServiceBuilderInterface $builder Service builder
*/
public static function setServiceBuilder(ServiceBuilderInterface $builder)
{
@ -102,7 +103,7 @@ abstract class GuzzleTestCase extends \PHPUnit_Framework_TestCase
/**
* Get a wildcard observer for an event dispatcher
*
* @param HasEventDispatcherInterface $hasEvent
* @param HasDispatcherInterface $hasEvent
*
* @return MockObserver
*/
@ -134,6 +135,8 @@ abstract class GuzzleTestCase extends \PHPUnit_Framework_TestCase
* Mark a request as being mocked
*
* @param RequestInterface $request
*
* @return self
*/
public function addMockedRequest(RequestInterface $request)
{
@ -207,7 +210,7 @@ abstract class GuzzleTestCase extends \PHPUnit_Framework_TestCase
* @param array $filteredHeaders Array of special headers
* @param array $actualHeaders Array of headers to check against
*
* @return array|false Returns an array of the differences or FALSE if none
* @return array|bool Returns an array of the differences or FALSE if none
*/
public function compareHeaders($filteredHeaders, $actualHeaders)
{