[GH-ISSUE #965] Create Barrier.pem also with cmdline barriers script #776

Open
opened 2026-05-05 07:05:41 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @wummel on GitHub (Dec 3, 2020).
Original GitHub issue: https://github.com/debauchee/barrier/issues/965

After starting barriers 2.3.3 on Debian Linux with --enable-crypt I get this error:

/usr/bin/barriers --enable-crypto --no-daemon --address 192.168.178.2 --config ~/.config/barrier/barrier.conf
started server (IPv4), waiting for clients
[2020-12-03T16:10:01] INFO: OpenSSL 1.1.1d  10 Sep 2019
[2020-12-03T16:10:01] ERROR: ssl certificate doesn't exist: $HOME/.local/share/barrier/SSL/Barrier.pem
[2020-12-03T16:10:05] NOTE: stopped server

But after starting the GUI "barrier", Barrier.pem is automatically generated. I detected this feature after searching the source code.

I expected Barrier.pem to be generated when starting barriers --enable-crypto.
Also, it would be nice to see some documentation about the automatic .pem-file generation in the .man pages.

thanks

Originally created by @wummel on GitHub (Dec 3, 2020). Original GitHub issue: https://github.com/debauchee/barrier/issues/965 After starting barriers 2.3.3 on Debian Linux with --enable-crypt I get this error: ``` /usr/bin/barriers --enable-crypto --no-daemon --address 192.168.178.2 --config ~/.config/barrier/barrier.conf started server (IPv4), waiting for clients [2020-12-03T16:10:01] INFO: OpenSSL 1.1.1d 10 Sep 2019 [2020-12-03T16:10:01] ERROR: ssl certificate doesn't exist: $HOME/.local/share/barrier/SSL/Barrier.pem [2020-12-03T16:10:05] NOTE: stopped server ``` But after starting the GUI "barrier", Barrier.pem is automatically generated. I detected this feature after searching the source code. I expected Barrier.pem to be generated when starting barriers --enable-crypto. Also, it would be nice to see some documentation about the automatic .pem-file generation in the .man pages. thanks
Author
Owner

@albertony commented on GitHub (Dec 6, 2020):

For information: I did actually include some documentation for how to generate the certificate and fingerprint manually in my recent wiki pull request https://github.com/debauchee/barrier-wiki/pull/5. See https://github.com/albertony/barrier-wiki/blob/local_config/Command-Line.md.

I included an example for Windows only, but I think for linux something like this should be equivalent:

openssl req -x509 -nodes -days 365 -subj /CN=Barrier -newkey rsa:2048 -keyout ~/.local/share/barrier/SSL/Barrier.pem -out ~/.local/share/barrier/SSL/Barrier.pem
openssl x509 -fingerprint -sha1 -noout -in ~/.local/share/barrier/SSL/Barrier.pem > ~/.local/share/barrier/SSL/SSL/Fingerprints\Local.txt

If your os setup uses XDG_DATA_HOME, i think the path prefix ~/.local/share/barrier/SSL should be replaced with $XDG_DATA_HOME/barrier/SSL.

Found the openssl arguments to use from https://github.com/debauchee/barrier/blob/master/src/gui/src/SslCertificate.cpp.

<!-- gh-comment-id:739582177 --> @albertony commented on GitHub (Dec 6, 2020): For information: I did actually include some documentation for how to generate the certificate and fingerprint manually in my recent wiki pull request https://github.com/debauchee/barrier-wiki/pull/5. See https://github.com/albertony/barrier-wiki/blob/local_config/Command-Line.md. I included an example for Windows only, but I think for linux something like this should be equivalent: ``` openssl req -x509 -nodes -days 365 -subj /CN=Barrier -newkey rsa:2048 -keyout ~/.local/share/barrier/SSL/Barrier.pem -out ~/.local/share/barrier/SSL/Barrier.pem openssl x509 -fingerprint -sha1 -noout -in ~/.local/share/barrier/SSL/Barrier.pem > ~/.local/share/barrier/SSL/SSL/Fingerprints\Local.txt ``` If your os setup uses XDG_DATA_HOME, i think the path prefix `~/.local/share/barrier/SSL` should be replaced with `$XDG_DATA_HOME/barrier/SSL`. Found the openssl arguments to use from https://github.com/debauchee/barrier/blob/master/src/gui/src/SslCertificate.cpp.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#776
No description provided.