Skip to content

Commit

Permalink
webui: disable verify_peer_name if verify_peer disabled
Browse files Browse the repository at this point in the history
This causes problems when I do not have trusted certificate. Turning
it off shall not cause any side-effects and is secure.
  • Loading branch information
Juraj Mlich ml committed Sep 2, 2018
1 parent 12e6863 commit 4d36c7b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php
Expand Up @@ -473,6 +473,7 @@ private function connect($username, $password)
* But that does mean we need to capture the certficate.
*/
$result = stream_context_set_option($context, 'ssl', 'verify_peer', false);
$result = stream_context_set_option($context, 'ssl', 'verify_peer_name', false);
$result = stream_context_set_option($context, 'ssl', 'capture_peer_cert', true);

/*
Expand All @@ -482,6 +483,7 @@ private function connect($username, $password)
$result = stream_context_set_option($context, 'ssl', 'cafile', $this->config['ca_file']);
if ($this->config['tls_verify_peer']) {
$result = stream_context_set_option($context, 'ssl', 'verify_peer', true);
$result = stream_context_set_option($context, 'ssl', 'verify_peer_name', true);
}
} else {
$result = stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
Expand Down

0 comments on commit 4d36c7b

Please sign in to comment.