Bug 266916 - net-im/signal-cli: Getting error 499 with all commands
Summary: net-im/signal-cli: Getting error 499 with all commands
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2022-10-09 11:52 UTC by Axel.Rau
Modified: 2023-12-31 15:26 UTC (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Axel.Rau 2022-10-09 11:52:51 UTC
Problem:
signal-cli gives this error with all commands:
`Error while checking account +some_phone_number: StatusCode: 499`
This makes signal-cli unusable.

Diagnosis:
499 means DeprecatedVersionException
Protocoll has been upgraded and the signal server refuses to talk to
clients with old protocol version.
All signal-cli clients below version 0.11.3 are affected by this.


Solution:
Upgrade this port to recent upstream release 0.11.3

References:
https://github.com/AsamK/signal-cli/issues/1022
Comment 1 Christian Gutzler 2022-10-16 15:33:42 UTC
Hi Axel (and rest of the world using signal-cli@FreeBSD):

There is a workaround available and I suggest using it as long as an upgraded port is not available. It´s simply replacing the user agent string with a new version (2x) in the base class:

https://github.com/AsamK/signal-cli/issues/1022

Needs to be adapted for FreeBSD due to a) older version number and b) different behaviour of sed:

cd /usr/local/share/signal-cli/lib/
mkdir tmp
cd tmp
unzip ../signal-cli-0.9.0.jar 
sed -i .h2ksux 's/Signal-Android\/5.22.3/Signal-Android\/5.51.7/g' org/asamk/signal/BaseConfig.class 
zip -r ../signal-cli-0.9.0.jar org/ META-INF/

Greetings from Mannheim and have fun
Christian
Comment 2 Axel.Rau 2022-10-18 14:40:31 UTC
Workaround does its job !
Comment 3 Axel.Rau 2022-10-30 12:15:11 UTC
There is another issue with version 0.9.0:

- - -
Error while checking account +some_phone_number: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- - -
The included cert store is outdated.
Just replacing whisper.store in lib.jar does not work.
Currently I see no workaround for 0.9.0.

Discussion upstream:
https://github.com/AsamK/signal-cli/issues/1067#issuecomment-1295204655
Comment 4 Christian Gutzler 2022-11-03 00:33:56 UTC
Yeah, new workaround works as well:

cd /usr/local/share/signal-cli/lib/
#if exists from previous workaround
rm -r tmp
mkdir tmp
mkdir hund
cd hund
wget https://github.com/AsamK/signal-cli/files/9891234/whisper.store.zip
unzip whisper.store.zip
cd ../tmp
unzip ../lib.jar 
mv ../hund/whisper.store org/asamk/signal/manager/config/whisper.store
zip -r ../lib.jar org/ META-INF/
cd ..
rm -r tmp
rm -r hund
Comment 5 Stefanie 2022-12-26 16:12:00 UTC
Hello everyone! 
sorry if I take up this path again but maybe the error that occurred to me has the same cause

I an using signal-cli under debian as an "emulator" for a non-existing smartphone.
I am receiving signal messages on the computer using signal-desktop. 
This has bin working fine until october, when signal-desktop reported that it was disconnected. 
I left the whole thing behind. 
Now played around with signal-cli again and always got the following error message: 
"signal-cli listDevices INFO ManagerImpl - The Signal protocol expects that incoming messages are regularly received. Error while checking account +49 ..: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”.

Somehow i found out that this could have been a bug that can be fixed with an update is that so?

I am working with the revision 0.9.2 of signal-cli

Thank you and best regards Stefanie (charis@august.de)


In this context I have further questions and would be pleased if someone could help me: 
1. if I delete and reinstall signal-cli now - will the settings remain - such as the registration of my telephone number? 
2. how do i delete this phone number using signal-cli and register a new one? 
3. does signal-cli also allow the outputs (messages) to be displayed on multiple devices (signal desktop runs on multiple computers)? 

Thanks and best regards Stefanie (charis@august.de)
Comment 6 ml 2023-12-31 15:26:13 UTC
Even with this workaround, the version currently in the port tree (0.9.0) is simply too old and does not work anymore.
I guess this bug should be closed as overcome by events.

I've opened a new bug (#276037) with patches to update to 0.12.5, which works for me.