Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit e89d79b

Browse files
committed
Merge pull request zendframework/zendframework#2150 from postalservice14/hotfix/ZF2-458
[WIP][RC4] SSL new options are not inherited in Socket subclasses
2 parents f329014 + 1db9cc9 commit e89d79b

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

src/Client/Adapter/Proxy.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,18 @@ class Proxy extends Socket
3434
* @var array
3535
*/
3636
protected $config = array(
37-
'ssltransport' => 'ssl',
38-
'sslcert' => null,
39-
'sslpassphrase' => null,
40-
'sslusecontext' => false,
41-
'proxy_host' => '',
42-
'proxy_port' => 8080,
43-
'proxy_user' => '',
44-
'proxy_pass' => '',
45-
'proxy_auth' => Client::AUTH_BASIC,
46-
'persistent' => false
37+
'ssltransport' => 'ssl',
38+
'sslcert' => null,
39+
'sslpassphrase' => null,
40+
'sslverifypeer' => true,
41+
'sslallowselfsigned' => false,
42+
'sslusecontext' => false,
43+
'proxy_host' => '',
44+
'proxy_port' => 8080,
45+
'proxy_user' => '',
46+
'proxy_pass' => '',
47+
'proxy_auth' => Client::AUTH_BASIC,
48+
'persistent' => false
4749
);
4850

4951
/**

test/Client/ProxyAdapterTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ public function testFallbackToSocket()
8787
));
8888

8989
$this->client->setUri($this->baseuri . 'testGetLastRequest.php');
90-
$res = $this->client->request(Client::TRACE);
91-
if ($res->getStatus() == 405 || $res->getStatus() == 501) {
90+
$res = $this->client->setMethod(\Zend\Http\Request::METHOD_TRACE)->send();
91+
if ($res->getStatusCode() == 405 || $res->getStatusCode() == 501) {
9292
$this->markTestSkipped('Server does not allow the TRACE method');
9393
}
9494

@@ -103,4 +103,11 @@ public function testGetLastRequest()
103103
* the TRACE response
104104
*/
105105
}
106+
107+
public function testDefaultConfig()
108+
{
109+
$config = $this->_adapter->getConfig();
110+
$this->assertEquals(TRUE, $config['sslverifypeer']);
111+
$this->assertEquals(FALSE, $config['sslallowselfsigned']);
112+
}
106113
}

0 commit comments

Comments
 (0)