debauchee / barrier

Open-source KVM software
Other
27.35k stars 1.51k forks source link

Barrier 2.4.0 does not create SSL certificate required for being a server, on any supported OS (Mac OS, Linux, Windows) #2076

Open LuboGD opened 2 months ago

LuboGD commented 2 months ago

What happened?

Confirmed this bug affects Debian and likely all distributions derived from it. Barrier 2.4.0 installed from distribution repositories, i.e. sudo apt install barrier Also Mac OS, from github binary releases.

Directory for SSL certificate on Linux (at least Debian and friends) is: /home/lubod/.local/share/barrier/SSL

on Mac OS: ~/Library/Application Support/Barrier/SSL

Same command as posted for Mac OS creates SSL certificate: openssl req -x509 -nodes -days 365 -subj /CN=Barrier -newkey rsa:4096 -keyout Barrier.pem -out Barrier.pem

Fix can be implemented by adding a post-install script to the existing .deb package that does:

!/bin/bash

# cd ~/.local/share/barrier/SSL openssl req -x509 -nodes -days 365 -subj /CN=Barrier -newkey rsa:4096 -keyout Barrier.pem -out Barrier.pem

and on Mac OS, add to package from which .dmg is built: cd ~/Library/Application Support/Barrier/SSL openssl req -x509 -nodes -days 365 -subj /CN=Barrier -newkey rsa:4096 -keyout Barrier.pem -out Barrier.pem

Already filed at: (including here for completeness) https://bugs.launchpad.net/ubuntu/+source/barrier/+bug/1995190/comments/5

Version

v2.4.0

Git commit hash (if applicable)

No response

If applicable, where did you install Barrier from?

Distribution repositories and github binary release.

What OSes are you seeing the problem on? (Check all that apply)

Linux, macOS

What OS versions are you using?

Debian 12 and Mac OS 10.13

Relevant log output

No response

Any other information

No response

GlennVanSchil commented 2 months ago

Just installed 2.4.0 and after setting up both server and client with auto-config, I get the following error when reach the edge of my screen

[2024-07-15T09:12:23] INFO: OpenSSL 3.0.0 7 sep 2021
[2024-07-15T09:12:23] ERROR: ssl certificate doesn't exist: /Users/glennvanschil/Library/Application Support/barrier/SSL/Barrier.pem

I see SSL errors on both server and client

MrYoloPotato commented 2 months ago

I can confirm that it also affects Windows. The workaround works the same with minor modifications, but an openssl binary would need to be included.

LuboGD commented 2 months ago

Autoconfig definitely does NOT work in 2.4.0 in Linux, it likely doesn't in Mac OS either. Uncheck auto config and manually enter the IP address of your server in your client. That works here. See screenshot below. working-not-auto-config-barrier

autoconfig generated the following errors in terminal when launching barrier: WARNING The program 'barrier' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html

Seems whoever wrote Avahi is saying Barrier needs to be rewritten to be compatible, and is not as of v. 2.4.0

ressy commented 2 months ago

@LuboGD's manual cert creation did the trick for me with a mac server and mac client both running Barrier 2.4.0. Thanks!

incenargo commented 3 weeks ago

Can confirm issue and fix on Fedora 40 KDE.

sinmentis commented 2 weeks ago

Same issue on Windows 11 and same workaround.