Skip to content

Commit 51a0828

Browse files
committed
Fix parse provided fingerprint on CLI from hex to bytes
1 parent 99cf549 commit 51a0828

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

threema-gateway

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def cli(ctx, verify_fingerprint, fingerprint):
3434
"""
3535
Command Line Interface. Use --help for details.
3636
"""
37+
if fingerprint is not None:
38+
fingerprint = binascii.unhexlify(fingerprint)
3739
ctx.obj = {
3840
'verify_fingerprint': verify_fingerprint,
3941
'fingerprint': fingerprint

threema/gateway/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
__author__ = 'Lennart Grahl <lennart.grahl@threema.ch>'
3737
__status__ = 'Production'
38-
__version__ = '2.1.3'
38+
__version__ = '2.1.4'
3939
__all__ = (
4040
'feature_level',
4141
'ReceptionCapability',
@@ -78,9 +78,9 @@ class Connection:
7878
- `verify_fingerprint`: Set to `True` if you want to verify the
7979
TLS certificate of the Threema Gateway Server by a
8080
fingerprint. (Recommended)
81-
- `fingerprint`: A hex-encoded fingerprint of an DER-encoded
82-
TLS certificate. Will fall back to a stored fingerprint which
83-
will be invalid as soon as the certificate expires.
81+
- `fingerprint`: A binary fingerprint of an DER-encoded TLS
82+
certificate. Will fall back to a stored fingerprint which will
83+
be invalid as soon as the certificate expires.
8484
"""
8585
fingerprint = b'm\x7f\xa3\x1d\x80\xdcV\xf9\xc1\xed\x17\x98*\xd6\x01\x7f'
8686
urls = {

0 commit comments

Comments
 (0)