Closed mmokrejs closed 1 year ago
You are running the client without client
or pull
ie in p2p mode. Either you run both sides in p2p mode or you one side with --server
and the other side with --pull
/--client
. Trying to use p2p mode one side and --server on the other will just break.
Differences in openvpn --show-ciphers
outputs:
$ diff -u -w /tmp/myserver.ciphers.txt /tmp/client2.ciphers.txt
--- /tmp/myserver.ciphers.txt 2023-07-17 15:31:00.268477628 +0200
+++ /tmp/client2.ciphers.txt 2023-07-17 15:31:28.668477493 +0200
@@ -9,16 +9,19 @@
AES-128-CFB (128 bit key, 128 bit block, TLS client/server mode only)
AES-128-CFB1 (128 bit key, 128 bit block, TLS client/server mode only)
AES-128-CFB8 (128 bit key, 128 bit block, TLS client/server mode only)
+AES-128-GCM (128 bit key, 128 bit block, TLS client/server mode only)
AES-128-OFB (128 bit key, 128 bit block, TLS client/server mode only)
AES-192-CBC (192 bit key, 128 bit block)
AES-192-CFB (192 bit key, 128 bit block, TLS client/server mode only)
AES-192-CFB1 (192 bit key, 128 bit block, TLS client/server mode only)
AES-192-CFB8 (192 bit key, 128 bit block, TLS client/server mode only)
+AES-192-GCM (192 bit key, 128 bit block, TLS client/server mode only)
AES-192-OFB (192 bit key, 128 bit block, TLS client/server mode only)
AES-256-CBC (256 bit key, 128 bit block)
AES-256-CFB (256 bit key, 128 bit block, TLS client/server mode only)
AES-256-CFB1 (256 bit key, 128 bit block, TLS client/server mode only)
AES-256-CFB8 (256 bit key, 128 bit block, TLS client/server mode only)
+AES-256-GCM (256 bit key, 128 bit block, TLS client/server mode only)
AES-256-OFB (256 bit key, 128 bit block, TLS client/server mode only)
ARIA-128-CBC (128 bit key, 128 bit block)
ARIA-128-CFB (128 bit key, 128 bit block, TLS client/server mode only)
@@ -54,29 +57,14 @@
CAMELLIA-256-CFB8 (256 bit key, 128 bit block, TLS client/server mode only)
CAMELLIA-256-OFB (256 bit key, 128 bit block, TLS client/server mode only)
CHACHA20-POLY1305 (256 bit key, stream cipher, TLS client/server mode only)
-SEED-CBC (128 bit key, 128 bit block)
-SEED-CFB (128 bit key, 128 bit block, TLS client/server mode only)
-SEED-OFB (128 bit key, 128 bit block, TLS client/server mode only)
SM4-CBC (128 bit key, 128 bit block)
SM4-CFB (128 bit key, 128 bit block, TLS client/server mode only)
+SM4-GCM (128 bit key, 128 bit block, TLS client/server mode only)
SM4-OFB (128 bit key, 128 bit block, TLS client/server mode only)
-AES-128-GCM (128 bit key, 128 bit block, TLS client/server mode only)
-AES-192-GCM (192 bit key, 128 bit block, TLS client/server mode only)
-AES-256-GCM (256 bit key, 128 bit block, TLS client/server mode only)
The following ciphers have a block size of less than 128 bits,
and are therefore deprecated. Do not use unless you have to.
-BF-CBC (128 bit key, 64 bit block)
-BF-CFB (128 bit key, 64 bit block, TLS client/server mode only)
-BF-OFB (128 bit key, 64 bit block, TLS client/server mode only)
-CAST5-CBC (128 bit key, 64 bit block)
-CAST5-CFB (128 bit key, 64 bit block, TLS client/server mode only)
-CAST5-OFB (128 bit key, 64 bit block, TLS client/server mode only)
-DES-CBC (64 bit key, 64 bit block)
-DES-CFB (64 bit key, 64 bit block, TLS client/server mode only)
-DES-CFB1 (64 bit key, 64 bit block, TLS client/server mode only)
-DES-CFB8 (64 bit key, 64 bit block, TLS client/server mode only)
DES-EDE-CBC (128 bit key, 64 bit block)
DES-EDE-CFB (128 bit key, 64 bit block, TLS client/server mode only)
DES-EDE-OFB (128 bit key, 64 bit block, TLS client/server mode only)
@@ -85,17 +73,4 @@
DES-EDE3-CFB1 (192 bit key, 64 bit block, TLS client/server mode only)
DES-EDE3-CFB8 (192 bit key, 64 bit block, TLS client/server mode only)
DES-EDE3-OFB (192 bit key, 64 bit block, TLS client/server mode only)
-DES-OFB (64 bit key, 64 bit block, TLS client/server mode only)
-DESX-CBC (192 bit key, 64 bit block)
-IDEA-CBC (128 bit key, 64 bit block)
-IDEA-CFB (128 bit key, 64 bit block, TLS client/server mode only)
-IDEA-OFB (128 bit key, 64 bit block, TLS client/server mode only)
-RC2-40-CBC (40 bit key, 64 bit block)
-RC2-64-CBC (64 bit key, 64 bit block)
-RC2-CBC (128 bit key, 64 bit block)
-RC2-CFB (128 bit key, 64 bit block, TLS client/server mode only)
-RC2-OFB (128 bit key, 64 bit block, TLS client/server mode only)
-RC5-CBC (128 bit key, 64 bit block)
-RC5-CFB (128 bit key, 64 bit block, TLS client/server mode only)
-RC5-OFB (128 bit key, 64 bit block, TLS client/server mode only)
client2 # emerge -pv openvpn openssl
These are the packages that would be merged, in order:
Calculating dependencies... done!
Dependency resolution took 1.72 s.
[ebuild R ] dev-libs/openssl-3.1.1-r1:0/3::gentoo USE="asm -fips -ktls -rfc3779 -sctp -static-libs -test -tls-compression -vanilla -verify-sig -weak-ssl-ciphers" CPU_FLAGS_X86="(sse2)" 0 KiB
[ebuild R ] net-vpn/openvpn-2.6.4::gentoo USE="inotify iproute2 lz4 lzo openssl pam plugins systemd -dco -down-root -examples -mbedtls -pkcs11 (-selinux) -test" 0 KiB
myserver # emerge -pv openvpn openssl
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] dev-libs/openssl-1.1.1u:0/1.1::gentoo USE="asm -rfc3779 -sctp (-sslv3) -static-libs -test -tls-compression -tls-heartbeat -vanilla -verify-sig -weak-ssl-ciphers" CPU_FLAGS_X86="(sse2)" 9,661 KiB
[ebuild R ] net-vpn/openvpn-2.6.4::gentoo USE="examples inotify iproute2 lz4 lzo openssl pam plugins -dco -down-root -mbedtls -pkcs11 (-selinux) -systemd -test" 0 KiB
Total: 2 packages (2 reinstalls), Size of downloads: 9,661 KiB
WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict:
dev-libs/openssl:0
(dev-libs/openssl-3.0.9-r1:0/3::gentoo, ebuild scheduled for merge) USE="asm -fips -ktls -rfc3779 -sctp -static-libs -test -tls-compression -vanilla -verify-sig -weak-ssl-ciphers" CPU_FLAGS_X86="(sse2)" conflicts with
>=dev-libs/openssl-1.0.0:0/1.1= required by (dev-db/mariadb-10.5.16:10.5/18::gentoo, installed) USE="backup cracklib pam perl server userland_GNU xml -bindist -columnstore -debug -extraengine -galera -innodb-lz4 -innodb-lzo -innodb-snappy -jdbc -jemalloc -kerberos -latin1 (-mroonga) -numa -odbc -oqgraph -profiling -rocksdb -s3 (-selinux) -sphinx -sst-mariabackup -sst-rsync -static -systemd -systemtap -tcmalloc -test -yassl"
^^^^^^^
Having a SSL lib without AES-GCM ciphers would be bad indeed - but this is not problem here, the server log shows that the client signals AES-GCM support, and the server is willing to accept it:
Jul 17 14:55:19 myserver openvpn[6673]: client2_ip:53828 peer info: IV_CIPHERS=AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305
Jul 17 14:55:20 myserver openvpn[6673]: client2.mydomain/client2_ip:53828 Data Channel: cipher 'AES-256-GCM', peer-id: 0
(maybe there is a bug lurking here, if the server SSL library really has no AES-256-GCM and we do not properly check, but this is not why the client is giving up)
Arne already spotted the real problem:
OpenVPN 2.6.x can auto-negotate ciphers in two modes - peer2peer (which means no client
and no server
or mode server
in the config, just udp-client
and udp-server
) or real point2multipoint. The second version has a real server
, and all clients must have client
in their config files.
The Android client can only do client, so it's possible that it can work "as client" if there is no client
in the config file - but the linux binary can do all variants, so it needs to be explicitely told what you want it to do.
With 2.5, such configs used to work (by falling back to BF-CBC), but this was more "good luck" than "by design" - and we needed to change this behaviour to get rid of BF-CBC, which is considered insecure today.
I apologize that during all my experiments I commented out the client
option from the config file. I was not aware of the P2P mode.
Indeed, the "OpenVPN for Android" app for openvpn 2.x core it included the client
option in the generated .ovpn
file, I just checked that now.
The openvpn --show-ciphers
should be stable-sorted, ideally.
Thank you for your help and detailed explanations.
--show-ciphers
is using the same order as OpenSSL provides. It is not intended for anything than debug purposes.
Provided I got the phone app working with
tls-crypt-v2
I find it cumbersome the Linux client fails with:ERROR: failed to negotiate cipher with peer and --data-ciphers-fallback not enabled. No usable data channel cipher
Here is a full log from client:
Server logged:
I edited the config files although some of the path are partly visible in the logs above:
2.6.4 client config:
2.6.4 server config: