Skip to content

Commit 12529e4

Browse files
panaceyalifeofguenter
authored andcommitted
ADD: option verify_peer_name (#57)
1 parent e6b1c3b commit 12529e4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/AfriCC/EPP/Client.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class Client
3838
protected $connect_timeout;
3939
protected $timeout;
4040
protected $chunk_size;
41+
protected $verify_peer_name;
4142

4243
public function __construct(array $config)
4344
{
@@ -108,6 +109,12 @@ public function __construct(array $config)
108109
} else {
109110
$this->chunk_size = 1024;
110111
}
112+
113+
if (!empty($config['verify_peer_name'])) {
114+
$this->verify_peer_name = (bool) $config['verify_peer_name'];
115+
} else {
116+
$this->verify_peer_name = true;
117+
}
111118
}
112119

113120
public function __destruct()
@@ -125,6 +132,7 @@ public function connect()
125132

126133
$context = stream_context_create();
127134
stream_context_set_option($context, 'ssl', 'verify_peer', false);
135+
stream_context_set_option($context, 'ssl', 'verify_peer_name', $this->verify_peer_name);
128136
stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
129137

130138
if ($this->local_cert !== null) {

0 commit comments

Comments
 (0)