View Issue Details

IDProjectCategoryView StatusLast Update
0001155bareos-coreGeneralpublic2021-03-19 22:41
Reporterbigz Assigned Tojoergs  
PriorityhighSeverityfeatureReproducibilityalways
Status assignedResolutionopen 
PlatformLinuxOSanyOS Version3
Product Version19.2.4~pre 
Summary0001155: Impossible to connect to a TLS with no PSK configured director
DescriptionI configured my director with TLS in a centos7 docker image.

I want to connect with python-bareos pip module on order to send a command. The python client does not support TLS configuration without PSK.

I think python client does not support this configuration. I do enhancement in my fork github repo (https://github.com/bigzbigz/bareos/tree/dev/bigz/master/python-support-tls-without-psk)

I plan to push a pull request on the officiel repo in order to fix the problem. I need your opinion before.


Steps To ReproduceI work in a venv

-> % pip install sslpsk python-bareos
[...]
-> % pip list
Package Version Location
--------------- ------- --------------------------------------------
pip 19.3.1
pkg-resources 0.0.0
python-bareos 18.2.5
python-dateutil 2.8.1
setuptools 42.0.2
six 1.13.0
sslpsk 1.0.0
wheel 0.33.6

I try with TLS-PSK require

-> % python bconsole.py -d --name bareos-dir --port 9101 --address bareos-dir -p $PASS --tls-psk-require
DEBUG bconsole.<module>: options: {'name': 'bareos-dir', 'password': 'xxxxxxxx', 'port': '9101', 'address': 'bareos-dir', 'protocolversion': 2, 'tls_psk_require': True}
DEBUG lowlevel.__init__: init
DEBUG lowlevel.__connect_plain: connected to bareos-dir:9101
DEBUG lowlevel.__connect_tls_psk: identity = R_CONSOLEbareos-dir, password = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Traceback (most recent call last):
  File "bconsole.py", line 28, in <module>
    director = bareos.bsock.DirectorConsole(**bareos_args)
  File "/home/user/Downloads/bareos/python-bareos/bareos/bsock/directorconsole.py", line 99, in __init__
    self.connect(address, port, dirname, ConnectionType.DIRECTOR, name, password)
  File "/home/user/Downloads/bareos/python-bareos/bareos/bsock/lowlevel.py", line 104, in connect
    return self.__connect()
  File "/home/user/Downloads/bareos/python-bareos/bareos/bsock/lowlevel.py", line 119, in __connect
    self.__connect_tls_psk()
  File "/home/user/Downloads/bareos/python-bareos/bareos/bsock/lowlevel.py", line 191, in __connect_tls_psk
    server_side=False)
  File "/home/user/.virtualenvs/bareos/lib/python3.7/site-packages/sslpsk/sslpsk.py", line 106, in wrap_socket
    _ssl_set_psk_client_callback(sock, cb)
  File "/home/user/.virtualenvs/bareos/lib/python3.7/site-packages/sslpsk/sslpsk.py", line 73, in _ssl_set_psk_client_callback
    ssl_id = _sslpsk.sslpsk_set_psk_client_callback(_sslobj(sock))
  File "/home/user/.virtualenvs/bareos/lib/python3.7/site-packages/sslpsk/sslpsk.py", line 55, in _sslobj
    return sock._sslobj._sslobj
AttributeError: '_ssl._SSLSocket' object has no attribute '_sslobj'

I try with no TLS-PSK require (default configuration)

-> % python bconsole.py -d --name bareos-dir --port 9101 --address bareos-dir -p $PASS
/home/user/Downloads/bareos/python-bareos/bareos/bsock/lowlevel.py:38: UserWarning: Connection encryption via TLS-PSK is not available, as the module sslpsk is not installed.
  warnings.warn(u'Connection encryption via TLS-PSK is not available, as the module sslpsk is not installed.')
DEBUG bconsole.<module>: options: {'name': 'bareos-dir', 'password': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'port': '9101', 'address': 'bareos-dir', 'protocolversion': 2, 'tls_psk_require': False}
DEBUG lowlevel.__init__: init
DEBUG lowlevel.__connect_plain: connected to bareos-dir:9101
DEBUG lowlevel.__connect: Encryption: None
DEBUG lowlevel.send: bytearray(b'Hello bareos-dir calling version 18.2.5')
DEBUG lowlevel.recv_bytes: expecting 4 bytes.
DEBUG lowlevel.recv: header: -4
WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
Received unexcepted signal: Conversation terminated (-4)
Additional InformationDirector configuration:
Director {
  Name = @@DIR_NAME@@-dir
  DIRport = 9101 # where we listen for UA connections
  QueryFile = "/usr/lib/bareos/scripts/query.sql"
  WorkingDirectory = "/var/spool/bareos"
  PidDirectory = "/var/run"
  Password = "@@DIR_PASSWORD@@" # Console password
  Messages = Daemon
  Auditing = yes
  TLS Enable = yes
  TLS Require = yes
  TLS DH File = /etc/ssl/dh1024.pem
  TLS CA Certificate File = /etc/ssl/certs/ca-bundle.crt
  TLS Key = /etc/ssl/private/client.key
  TLS Certificate = /etc/ssl/certs/client.pem
}
TagsNo tags attached.
bareos-master: impactyes
bareos-master: action
bareos-19.2: impactyes
bareos-19.2: action
bareos-18.2: impactyes
bareos-18.2: actionnone
bareos-17.2: impactyes
bareos-17.2: actionnone
bareos-16.2: impactyes
bareos-16.2: actionnone
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action

Activities

arogge

arogge

2019-12-13 10:46

developer   ~0003663

Thanks for taking a look.
I'm not sure I already understand what happens in your environment. However, if you want to touch the code, you should probably checkout the master branch and use python-bareos from there.
bigz

bigz

2019-12-13 10:57

reporter   ~0003664

I verify the error with the code from the master branch in python-bareos folder.
joergs

joergs

2019-12-13 11:39

developer   ~0003665

it is correct, that python-bareos does not support TLS other then TLS-PSK.
My assumption has been, that most new installations will use TLS-PSK. However, a patch to also support normal TLS without PSK is welcome.
I took a first look at your code. It looks good so far.
However, if I read it correctly, you allow TLS, but don't verify against a custom CA? Have I missed something there or is it your intention to plainly accepting all TLS connections?

Have you seen the systemtest testing the python-bareos authentication?
See https://docs.bareos.org/master/DeveloperGuide/BuildAndTestBareos.html#building-the-test-environment

Instead of running all tests, you can also change to the build/systemtests/tests/python-bareos-test directory and run "./testrunner" from there.
This way you can verify, that your change to not change existing behavior and maybe you can add extra tests for your functionality.

With what version of Python have you tested? I experienced difficulties with the Python3 version of sslpsk. What OS/distribution did you use, as at least on new Fedora (>=30) systems there are also compile problems with sslpsk?

Currently, we use tls_psk_enable and tls_psk_require parameter. You added tls_enable and tls_require. I'm not sure, if this is the best way to configure it, especially, if more parameter as CA are required. I'll discuss about this in our next developer meeting.
bigz

bigz

2019-12-13 12:06

reporter   ~0003666

You can use a custom CA (this is my configuration). The use of ssl.wrap_socket automatically check the CA you installed in the operating system (normally in /etc/ssl/certs). It is possible to load an extra CA chain

I don't see the systemtest. I use my travis-ci account to check the existing CI from the official repo.
I will think about if a new test is possible to verify my enhancement.

I use Python 3.7.3 version. My OS is Ubuntu 19.04 and I use official python package. Modules are installed with a virtualenv with pip command.
bigz

bigz

2019-12-14 22:01

reporter   ~0003668

Last edited: 2019-12-14 22:30

Hello joergs
I have difficulties to build bareos project with cmake like you explain in your note. I think I have dependencies missing but I don't find which one is missing. I installed libacl1-dev and zlib1g-dev on my ubuntu19.04. Do you have the list of dependencies packages is needed ?
When I use this command I have this error.
-> % cmake -Dsqlite3=yes -Dtraymonitor=yes ../bareos
[...]
-- Disabled test: system:bconsole-pam
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Readline_INCLUDE_DIR (ADVANCED)
   used as include directory in directory /home/user/Perso/clion/bareos/core/src/console
   used as include directory in directory /home/user/Perso/clion/bareos/core/src/console
   used as include directory in directory /home/user/Perso/clion/bareos/core/src/console
   used as include directory in directory /home/user/Perso/clion/bareos/core/src/console
   used as include directory in directory /home/user/Perso/clion/bareos/core/src/console
   used as include directory in directory /home/user/Perso/clion/bareos/core/src/console
   used as include directory in directory /home/user/Perso/clion/bareos/core/src/console
   used as include directory in directory /home/user/Perso/clion/bareos/core/src/console
   used as include directory in directory /home/user/Perso/clion/bareos/core/src/console

I don't understand the error
Thanks

bigz

bigz

2019-12-14 23:40

reporter   ~0003669

I passed to build the project...I continue investigation but my previous errors are solved
joergs

joergs

2019-12-15 09:48

developer   ~0003670

Good that you passed the build process. You find the dependency packages in the files we use to create Debian packages: https://github.com/bareos/bareos/blob/master/core/platforms/packaging/bareos.dsc and/or https://github.com/bareos/bareos/blob/master/core/debian/control (or http://download.bareos.org/bareos/experimental/nightly/xUbuntu_18.04/bareos_19.2.4*.dsc). Make sure to have libjansson-dev installed, otherwise, Bareos will build but misses functionality required for the test.
bigz

bigz

2019-12-15 14:51

reporter   ~0003671

Hello,
I have a small error in ./testrunner

-> % /bin/zsh /home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/testrunner [devel|…]
creating database (sqlite3)
running /home/user/Perso/clion/bareos/cmake-build-release/systemtests/scripts/setup
 
 
=== python-bareos-test: starting at 14:46:34 ===
=
=
exit(0) is called. Set test to failure and end test.
end_test:7: no matches found: /home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/working/bareos.*.traceback
end_test:8: no matches found: /home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/working/bareos.*.traceback
end_test:9: no matches found: /home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/working/*.bactrace
end_test:10: no matches found: /home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/working/*.bactrace
 
  !!!!! python-bareos-test failed!!! 14:46:34 !!!!!
   Status: estat=998 zombie=0 backup=0 restore=0 diff=0
 
I think I don't understand the behavior of the start_test() function in functions. A trap is added at the beginning of the function and the trap is always taken at the end of this start_test() function as a consequence end_test() is called and no tests are done. Is it a desired bahavior ?
joergs

joergs

2019-12-15 19:26

developer   ~0003672

Interesting. However, this problem does only occur when using zsh. It seams, that you are the first who ever tried it with it. Normally, we use bash (dash) or ksh. With these, the test runs as expected.
bigz

bigz

2019-12-16 20:22

reporter   ~0003675

Last edited: 2019-12-16 22:30

Problem is solved and it comes with my zsh interpreter. I just change it with bash.
I already have a problem because I use default python3.7 version of my ubuntu OS. It seems to have a problem with sslpsk module and python version 3.7 (https://github.com/drbild/sslpsk/issues/11). I will try with python3.6 and I'll give you the answer.

bigz

bigz

2019-12-17 22:44

reporter   ~0003679

I change my python version to 3.6.5 in order to avoid sslpsk problem
Sorry but I already have errors when I execute ./testrunner from master branch. I upload console.log file with stdout.

Please could you watch and tell me what do you think about ? In my opinion problem comes from "WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)". In this situation, the connection falls back in plain and the test fails.
I have no problem when I use builded bconsole -c bconsole-admin-tls.conf or bconsole -c bconsole-admin-notls.conf command. All of 2 are encrypted with TLS_CHACHA20_POLY1305_SHA256
I try to google ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT but I don't find an interesting answer.
Maybe you have an opinion on the problem ?
As you send in your email, I will create a draft pull request tomorrow.
console.log (32,684 bytes)   
-> % ./testrunner                                                                                           [devel|…]
creating database (sqlite3)
running /home/user/Perso/clion/bareos/cmake-build-release/systemtests/scripts/setup
 
 
=== python-bareos-test: starting at 22:31:00 ===
=
=
test_restore_with_client_acl (__main__.PythonBareosAclTest) ... 2019-12-17 22:31:00,858 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:00,858 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 46980), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:00,863 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:00,863 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:00,865 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ERROR
test_execute_external_command (__main__.PythonBareosFiledaemonTest) ... 2019-12-17 22:31:01,003 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:01,003 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 58846), raddr=('127.0.0.1', 42102)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:01,005 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
ERROR
test_status (__main__.PythonBareosFiledaemonTest) ... 2019-12-17 22:31:01,009 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:01,010 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 58850), raddr=('127.0.0.1', 42102)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:01,011 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
ERROR
test_json_list_jobid_with_job_acl (__main__.PythonBareosJsonAclTest) ... 2019-12-17 22:31:01,016 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:01,017 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 46994), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:01,018 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:01,018 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:01,022 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ERROR
test_json_list_media_with_pool_acl (__main__.PythonBareosJsonAclTest) ... 2019-12-17 22:31:01,158 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:01,158 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47000), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:01,160 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:01,160 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:01,163 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ERROR
test_json_backend (__main__.PythonBareosJsonBackendTest) ... 2019-12-17 22:31:01,298 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:01,298 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47006), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:01,300 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:01,300 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:01,303 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
FAIL
test_json_backend_without_json_input (__main__.PythonBareosJsonBackendTest) ... 2019-12-17 22:31:01,438 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:01,438 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47014), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:01,439 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:01,440 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:01,443 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
2019-12-17 22:31:01,533 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:01,533 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47020), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:01,535 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:01,535 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:01,538 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ok
test_json_no_api_command (__main__.PythonBareosJsonBackendTest) ... 2019-12-17 22:31:01,717 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:01,718 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47026), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:01,721 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019)'
ok
test_json_whoami (__main__.PythonBareosJsonBackendTest) ... 2019-12-17 22:31:01,814 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:01,814 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47030), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:01,814 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:01,815 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:01,815 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ok
test_json_with_invalid_command (__main__.PythonBareosJsonBackendTest) ... 2019-12-17 22:31:01,949 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:01,950 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47036), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:01,951 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:01,951 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:01,955 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ok
test_exception_connection_error (__main__.PythonBareosModuleTest) ... ok
test_exception_signal_received (__main__.PythonBareosModuleTest) ... ok
test_protocol_message (__main__.PythonBareosModuleTest) ... /home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py:115: DeprecationWarning: Please use assertRegex instead.
  self.assertRegexpMatches(hello_message, expected_regex)
ok
test_json_without_json_backend (__main__.PythonBareosPlainTest) ... 2019-12-17 22:31:02,091 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:02,092 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47042), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:02,093 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:02,094 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:02,097 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ok
test_login_as_root (__main__.PythonBareosPlainTest) ... 2019-12-17 22:31:02,233 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:02,234 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47048), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:02,235 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:02,235 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:02,239 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ok
test_login_as_user (__main__.PythonBareosPlainTest) ... 2019-12-17 22:31:02,329 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:02,330 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47054), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:02,331 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:02,331 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:02,335 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ok
test_login_to_noexisting_host (__main__.PythonBareosPlainTest) ... 2019-12-17 22:31:02,422 WARNING lowlevel._handleSocketError: socket error: [Errno 111] Connection refused
2019-12-17 22:31:02,422 WARNING lowlevel._handleSocketError: socket error: Failed to connect to host localhost, port 9: [Errno 111] Connection refused
2019-12-17 22:31:02,422 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
2019-12-17 22:31:02,423 WARNING lowlevel._handleSocketError: socket error: [Errno 111] Connection refused
ok
test_login_with_not_existing_username (__main__.PythonBareosPlainTest) ... 2019-12-17 22:31:02,426 WARNING lowlevel._handleSocketError: socket error: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:833)
2019-12-17 22:31:02,427 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47064), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:02,428 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:02,428 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:02,429 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
ok
test_login_with_wrong_password (__main__.PythonBareosPlainTest) ... 2019-12-17 22:31:02,433 WARNING lowlevel._handleSocketError: socket error: [SSL: SSLV3_ALERT_ILLEGAL_PARAMETER] sslv3 alert illegal parameter (_ssl.c:833)
2019-12-17 22:31:02,433 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47070), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:02,434 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:02,435 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:02,436 ERROR lowlevel._cram_md5_respond: failed: bytearray(b'1999 Authorization failed.\n')
ok
test_no_autodisplay_command (__main__.PythonBareosPlainTest) ... 2019-12-17 22:31:02,441 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:02,441 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47076), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:02,445 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019)'
ok
test_login_notls_notls (__main__.PythonBareosProtocol124Test) ... 2019-12-17 22:31:02,621 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ok
test_login_notls_tls (__main__.PythonBareosProtocol124Test) ... 2019-12-17 22:31:02,713 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ok
test_login_tls_notls (__main__.PythonBareosProtocol124Test) ... 2019-12-17 22:31:02,805 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:02,806 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47084), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:02,809 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
FAIL
test_login_tls_tls (__main__.PythonBareosProtocol124Test) ... 2019-12-17 22:31:02,902 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:02,902 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47088), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:02,906 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
FAIL
test_login_notls_notls (__main__.PythonBareosTlsPskTest) ... 2019-12-17 22:31:02,998 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019)'
ok
test_login_notls_tls (__main__.PythonBareosTlsPskTest) ... 2019-12-17 22:31:03,131 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:03,131 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:03,134 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
ok
test_login_notls_tls_fixprotocolversion (__main__.PythonBareosTlsPskTest) ... 2019-12-17 22:31:03,223 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
ok
test_login_tls_notls (__main__.PythonBareosTlsPskTest) ... 2019-12-17 22:31:03,227 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:03,227 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47100), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:03,231 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019)'
FAIL
test_login_tls_tls (__main__.PythonBareosTlsPskTest) ... 2019-12-17 22:31:03,365 WARNING lowlevel._handleSocketError: socket error: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:833)
2019-12-17 22:31:03,365 WARNING lowlevel.__connect: Failed to connect via TLS-PSK. Trying plain connection.
/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py:125: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 47104), raddr=('127.0.0.1', 42101)>
  self.logger.warning(u'Failed to connect via TLS-PSK. Trying plain connection.')
2019-12-17 22:31:03,366 WARNING lowlevel._handleSocketError: socket error: Conversation terminated (-4)
2019-12-17 22:31:03,366 WARNING lowlevel.__connect: Failed to connect using protocol version 2. Trying protocol version 1. 
2019-12-17 22:31:03,369 INFO directorconsole.finalize_authentication: Authentication: b'OK: bareos-dir Version: 19.2.4~pre1175.05b7022a5 (14 December 2019) --  Encryption: None\n'
FAIL

======================================================================
ERROR: test_restore_with_client_acl (__main__.PythonBareosAclTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 782, in test_restore_with_client_acl
    result = director_root.call('run job=backup-bareos-fd level=Full yes')
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/directorconsolejson.py", line 43, in call
    raise bareos.exceptions.JsonRpcErrorReceivedException(json)
bareos.exceptions.JsonRpcErrorReceivedException: failed: Job failed.


======================================================================
ERROR: test_execute_external_command (__main__.PythonBareosFiledaemonTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 236, in auth
    (ssl, result_compatible, result) = self._cram_md5_respond(password=self.password.md5(), tls_remote_need=0)
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 564, in _cram_md5_respond
    msg = self.recv()
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 370, in recv
    raise bareos.exceptions.SignalReceivedException(header)
bareos.exceptions.SignalReceivedException: Conversation terminated (-4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 1126, in test_execute_external_command
    password=bareos_password)
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/filedaemon.py", line 78, in __init__
    self.connect(address, port, dirname, ConnectionType.FILEDAEMON, name, password)
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 104, in connect
    return self.__connect()
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 138, in __connect
    auth = self.auth()
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 239, in auth
    raise bareos.exceptions.AuthenticationError('Received unexcepted signal: {0}'.format(str(e)))
bareos.exceptions.AuthenticationError: Received unexcepted signal: Conversation terminated (-4)

======================================================================
ERROR: test_status (__main__.PythonBareosFiledaemonTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 236, in auth
    (ssl, result_compatible, result) = self._cram_md5_respond(password=self.password.md5(), tls_remote_need=0)
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 564, in _cram_md5_respond
    msg = self.recv()
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 370, in recv
    raise bareos.exceptions.SignalReceivedException(header)
bareos.exceptions.SignalReceivedException: Conversation terminated (-4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 1092, in test_status
    password=bareos_password)
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/filedaemon.py", line 78, in __init__
    self.connect(address, port, dirname, ConnectionType.FILEDAEMON, name, password)
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 104, in connect
    return self.__connect()
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 138, in __connect
    auth = self.auth()
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/lowlevel.py", line 239, in auth
    raise bareos.exceptions.AuthenticationError('Received unexcepted signal: {0}'.format(str(e)))
bareos.exceptions.AuthenticationError: Received unexcepted signal: Conversation terminated (-4)

======================================================================
ERROR: test_json_list_jobid_with_job_acl (__main__.PythonBareosJsonAclTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 1045, in test_json_list_jobid_with_job_acl
    director=director_root, jobname=jobname1, level=u'Full', wait=True)
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 573, in run_job
    result = director.call('run {}'.format(u' '.join(run_parameter)))
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/directorconsolejson.py", line 43, in call
    raise bareos.exceptions.JsonRpcErrorReceivedException(json)
bareos.exceptions.JsonRpcErrorReceivedException: failed: Job failed.


======================================================================
ERROR: test_json_list_media_with_pool_acl (__main__.PythonBareosJsonAclTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 926, in test_json_list_media_with_pool_acl
    jobIdFull = self.run_job(director_root, 'backup-bareos-fd', 'Full', wait=True)
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 573, in run_job
    result = director.call('run {}'.format(u' '.join(run_parameter)))
  File "/home/user/Perso/clion/bareos/python-bareos/bareos/bsock/directorconsolejson.py", line 43, in call
    raise bareos.exceptions.JsonRpcErrorReceivedException(json)
bareos.exceptions.JsonRpcErrorReceivedException: failed: Job failed.


======================================================================
FAIL: test_json_backend (__main__.PythonBareosJsonBackendTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 666, in test_json_backend
    'Failed to retrieve client {} from "list clients"'.format(client))
AssertionError: Failed to retrieve client bareos-fd from "list clients"

======================================================================
FAIL: test_login_tls_notls (__main__.PythonBareosProtocol124Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 347, in test_login_tls_notls
    self.assertTrue(hasattr(director.socket, 'cipher'))
AssertionError: False is not true

======================================================================
FAIL: test_login_tls_tls (__main__.PythonBareosProtocol124Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 376, in test_login_tls_tls
    self.assertTrue(hasattr(director.socket, 'cipher'))
AssertionError: False is not true

======================================================================
FAIL: test_login_tls_notls (__main__.PythonBareosTlsPskTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 497, in test_login_tls_notls
    self.assertTrue(hasattr(director.socket, 'cipher'))
AssertionError: False is not true

======================================================================
FAIL: test_login_tls_tls (__main__.PythonBareosTlsPskTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user/Perso/clion/bareos/cmake-build-release/systemtests/tests/python-bareos-test/python-bareos-unittest.py", line 522, in test_login_tls_tls
    self.assertTrue(hasattr(director.socket, 'cipher'))
AssertionError: False is not true

----------------------------------------------------------------------
Ran 29 tests in 2.601s

FAILED (failures=5, errors=5)
ERROR: 
ERROR: 
 
  !!!!! python-bareos-test failed!!! 22:31:03 !!!!! 
   Status: estat=9 zombie=0 backup=0 restore=0 diff=0
console.log (32,684 bytes)   
bigz

bigz

2019-12-18 22:48

reporter   ~0003705

Last edited: 2019-12-18 23:10

Hello,
I work today and I rebase to the bareos master branch. I do not have the problem anymore. You have been doing commits in last few days but I don't understand how do you solve my problem

I did small fixes in python-bareos with a pull request in bareos github repo.

I already have error when I execute python unittests .Do you manage to perfom the unittest ? Do you send me a log file of the execution ?

Thanks

joergs

joergs

2019-12-19 12:55

developer   ~0003707

Hi, I accepted https://github.com/bareos/bareos/pull/382.

Have I understood you correctly, that connecting to a Director console without TLS-PSK, but with TLS by certificate does work now? I've not changed the behavior intentionally.

The systemtest also fails on my system when using Python 3. With Python 2 it works without problems. I assumed a general problem with sslpsk on Python 3, but after you saying, it works somehow in your environment, I assumend a local problem.
After your hint, I checked the project https://github.com/drbild/sslpsk again and saw, that the example code works on Python 3. I hope to find the time to check about this in more detail soon.
joergs

joergs

2019-12-20 17:22

developer   ~0003712

I'm not sure, what have changed, but the example and test code from https://github.com/drbild/sslpsk does no longer work on my machine.
bigz

bigz

2019-12-21 14:42

reporter   ~0003713

Hello,
It seems to don't work for him as well => https://travis-ci.org/drbild/sslpsk
b.braunger@syseleven.de

b.braunger@syseleven.de

2021-03-18 16:18

reporter   ~0004100

I have to hosts using python-baroes with sslpsk. One Ubuntu 14.04 with python 3.4 (works well) and one Ubuntu 20.04 with python 3.6 which throw this error:

ssl.SSLError: [SSL: ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT] attempt to reuse session in different context (_ssl.c:852)

Am I getting that right, that sslpsk version 1.0.0 seems not to work on modern systems at all?

One can circumvent this problem by setting tls_psk_require=False and let the connection fallback to unencrypted mode.
joergs

joergs

2021-03-18 16:25

developer   ~0004101

Yes, this is correct. Another way to circumvent this problem is described at https://docs.bareos.org/master/include/autogenerated/autosummary/python-bareos/bareos.bsock.html#transport-encryption-tls-psk

Basically is says, use the latest version from sslpsk master and set it ti TLSv1.2.
bigz

bigz

2021-03-19 22:41

reporter   ~0004102

I confirm joergs' words

Issue History

Date Modified Username Field Change
2019-12-13 09:31 bigz New Issue
2019-12-13 10:46 arogge Note Added: 0003663
2019-12-13 10:55 joergs Assigned To => joergs
2019-12-13 10:55 joergs Status new => assigned
2019-12-13 10:57 bigz Note Added: 0003664
2019-12-13 11:39 joergs Status assigned => feedback
2019-12-13 11:39 joergs Note Added: 0003665
2019-12-13 11:41 joergs Severity crash => feature
2019-12-13 11:41 joergs Product Version 18.2.5 => 19.2.4~pre
2019-12-13 11:41 joergs bareos-master: impact => yes
2019-12-13 11:41 joergs bareos-19.2: impact => yes
2019-12-13 11:41 joergs bareos-18.2: impact => yes
2019-12-13 11:41 joergs bareos-18.2: action => none
2019-12-13 11:41 joergs bareos-17.2: impact => yes
2019-12-13 11:41 joergs bareos-17.2: action => none
2019-12-13 11:41 joergs bareos-16.2: impact => yes
2019-12-13 11:41 joergs bareos-16.2: action => none
2019-12-13 12:06 bigz Note Added: 0003666
2019-12-13 12:06 bigz Status feedback => assigned
2019-12-14 22:01 bigz Note Added: 0003668
2019-12-14 22:30 bigz Note Edited: 0003668
2019-12-14 23:40 bigz Note Added: 0003669
2019-12-15 09:48 joergs Note Added: 0003670
2019-12-15 14:51 bigz Note Added: 0003671
2019-12-15 19:26 joergs Note Added: 0003672
2019-12-16 20:22 bigz Note Added: 0003675
2019-12-16 22:30 bigz Note Edited: 0003675
2019-12-17 22:44 bigz File Added: console.log
2019-12-17 22:44 bigz Note Added: 0003679
2019-12-18 22:48 bigz Note Added: 0003705
2019-12-18 23:10 bigz Note Edited: 0003705
2019-12-19 12:55 joergs Note Added: 0003707
2019-12-20 17:22 joergs Note Added: 0003712
2019-12-21 14:42 bigz Note Added: 0003713
2021-03-18 16:18 b.braunger@syseleven.de Note Added: 0004100
2021-03-18 16:25 joergs Note Added: 0004101
2021-03-19 22:41 bigz Note Added: 0004102