git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
852f128
)
improve https via socket
author
gggeek
<giunta.gaetano@gmail.com>
Mon, 6 Nov 2017 00:56:57 +0000
(
00:56
+0000)
committer
gggeek
<giunta.gaetano@gmail.com>
Mon, 6 Nov 2017 00:56:57 +0000
(
00:56
+0000)
src/Client.php
patch
|
blob
|
history
diff --git
a/src/Client.php
b/src/Client.php
index
b2f5175
..
4279ebc
100644
(file)
--- a/
src/Client.php
+++ b/
src/Client.php
@@
-766,7
+766,7
@@
class Client
$contextOptions['ssl']['local_pk'] = $key;
}
$contextOptions['ssl']['verify_peer'] = $this->verifypeer;
$contextOptions['ssl']['local_pk'] = $key;
}
$contextOptions['ssl']['verify_peer'] = $this->verifypeer;
-
+ $contextOptions['ssl']['verify_peer_name'] = $this->verifypeer;
}
$context = stream_context_create($contextOptions);
}
$context = stream_context_create($contextOptions);
@@
-779,13
+779,17
@@
class Client
$this->errno = 0;
$this->errstr = '';
$this->errno = 0;
$this->errstr = '';
- $fp = stream_socket_client("$transport://$connectServer:$connectPort", $this->errno, $this->errstr, $connectTimeout,
+ $fp =
@
stream_socket_client("$transport://$connectServer:$connectPort", $this->errno, $this->errstr, $connectTimeout,
STREAM_CLIENT_CONNECT, $context);
if ($fp) {
if ($timeout > 0) {
stream_set_timeout($fp, $timeout);
}
} else {
STREAM_CLIENT_CONNECT, $context);
if ($fp) {
if ($timeout > 0) {
stream_set_timeout($fp, $timeout);
}
} else {
+ if ($this->errstr == '') {
+ $err = error_get_last();
+ $this->errstr = $err['message'];
+ }
$this->errstr = 'Connect error: ' . $this->errstr;
$r = new Response(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr . ' (' . $this->errno . ')');
$this->errstr = 'Connect error: ' . $this->errstr;
$r = new Response(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr . ' (' . $this->errno . ')');