Am 04.02.19 um 17:34 schrieb Piotr Skw:
> bareos 18.2.5 clean instalation in centos 7
> 
> bareos-filedaemon-18.2.5-139.1.el7.x86_64
> bareos-storage-18.2.5-139.1.el7.x86_64
> bareos-database-tools-18.2.5-139.1.el7.x86_64
> bareos-client-18.2.5-139.1.el7.x86_64
> bareos-database-mysql-18.2.5-139.1.el7.x86_64
> bareos-bconsole-18.2.5-139.1.el7.x86_64
> bareos-webui-18.2.5-126.1.el7.noarch
> bareos-common-18.2.5-139.1.el7.x86_64
> bareos-database-common-18.2.5-139.1.el7.x86_64
> bareos-tools-18.2.5-139.1.el7.x86_64
> bareos-director-18.2.5-139.1.el7.x86_64
> 
> selinux and iptables disabled
> 
> and added user in bconsole
> 
> configure add console name=admin password=12345678 profile=webui-admin
> 
> but webui show:
> 
> Sorry, can not authenticate. Wrong username and/or password.
> 
> and in apache logs:
> 
> [Mon Feb 04 16:51:23.257047 2019] [:error] [pid 4384] [client 
> 10.22.108.51:32920] PHP Notice:  fwrite(): send of 26 bytes failed with 
> errno=104 Connection reset by peer in 
> /usr/share/bareos-webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php on 
> line 219, referer: http://xxxxxx/bareos-webui/
> 
> any sugestions ?
> 

Default PHP version in CentOS 7 is 5.4. Unfortunately
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT was introduced with PHP 5.6.

I'm pretty sure this is why you encounter the connection reset by peer
problem while having TLS enabled.

We need to take care here that calling stream_socket_enable_crypto
method works with PHP versions prior 5.6.0 as well.

I created a but report and a PR on GitHub which fixes the problem, see
https://bugs.bareos.org/view.php?id=1045 and
https://github.com/bareos/bareos/pull/144.

The patch is also attached to this mail in case you want to apply it
yourself.


Thanks for reporting the issue.


Cheers
Frank

-- 
Frank Bergkemper                   [email protected]
Bareos GmbH & Co. KG               Phone: +49-221-630693-94
http://www.bareos.com

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Komplementär: Bareos Verwaltungs-GmbH
Geschäftsführer: Stephan Dühr, M. Außendorf, J. Steffens, P. Storz

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.
From 96defb759fd31c8de92f4439e86a8d7b032e9eca Mon Sep 17 00:00:00 2001
From: Frank Bergkemper <[email protected]>
Date: Tue, 5 Feb 2019 10:52:26 +0100
Subject: [PATCH] webui: webui login problem with tls enabled

STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT was introduced with PHP version
5.6.0. We need to care that calling stream_socket_enable_crypto method works
with versions < 5.6.0 as well.

Fixes #1045: webui login problem
---
 webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php b/webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php
index 14d8fe1bb..8bd440f83 100644
--- a/webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php
+++ b/webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php
@@ -535,7 +535,12 @@ class BareosBSock implements BareosBSockInterface
       if (($this->config['server_can_do_tls'] || $this->config['server_requires_tls']) &&
          ($this->config['client_can_do_tls'] || $this->config['client_requires_tls'])) {
 
-         $crypto_method = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
+         $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
+
+         if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
+            $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
+         }
+
          $result = stream_socket_enable_crypto($this->socket, true, $crypto_method);
 
          if (!$result) {
-- 
2.20.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to