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

Commit 3025666

Browse files
committed
Merge branch 'hotfix/revert-zf2-490-fix' of https://github.com/ralphschindler/zf2
5 parents e9fa593 + 2844dba + c6a2f3e + 1325999 + 9eb9ff0 commit 3025666

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

src/Client/Adapter/Socket.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,14 @@ public function connect($host, $port = 80, $secure = false)
191191
$this->config['sslverifypeer'])) {
192192
throw new AdapterException\RuntimeException('Unable to set sslverifypeer option');
193193
}
194-
if ($this->config['sslverifypeer'] == true) {
195-
if ($this->config['sslcapath'] == null || !is_dir($this->config['sslcapath'])) {
196-
throw new AdapterException\RuntimeException('Invalid sslcapath provided; not a directory');
197-
}
198-
if (! stream_context_set_option($context, 'ssl', 'capath',
199-
$this->config['sslcapath'])) {
200-
throw new AdapterException\RuntimeException('Unable to set sslcapath option');
201-
}
202-
if ($this->config['sslallowselfsigned'] !== null) {
203-
if (! stream_context_set_option($context, 'ssl', 'allow_self_signed',
204-
$this->config['sslallowselfsigned'])) {
205-
throw new AdapterException\RuntimeException('Unable to set sslallowselfsigned option');
206-
}
194+
if (! stream_context_set_option($context, 'ssl', 'capath',
195+
$this->config['sslcapath'])) {
196+
throw new AdapterException\RuntimeException('Unable to set sslcapath option');
197+
}
198+
if ($this->config['sslallowselfsigned'] !== null) {
199+
if (! stream_context_set_option($context, 'ssl', 'allow_self_signed',
200+
$this->config['sslallowselfsigned'])) {
201+
throw new AdapterException\RuntimeException('Unable to set sslallowselfsigned option');
207202
}
208203
}
209204
}

test/Client/SocketTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,6 @@ public function testMultibyteChunkedResponseZF6218()
244244
$this->assertEquals($md5, md5($response->getBody()));
245245
}
246246

247-
/**
248-
* @group ZF2-490
249-
*/
250-
public function testSocketThrowsExceptionWhenSslCaPathNotProvided()
251-
{
252-
$request = new \Zend\Http\Request();
253-
$request->setUri('https://www.google.com');
254-
255-
$this->setExpectedException('Zend\Http\Client\Adapter\Exception\RuntimeException', 'Invalid sslcapath provided; not a directory');
256-
$this->client->send($request);
257-
}
258-
259247
/**
260248
* Data Providers
261249
*/

0 commit comments

Comments
 (0)