Closed mattc321 closed 2 years ago
Can you please provide the log output of openvpn2 --config $CONFIG_FILE --verb 6
?
openvpn2 --config $CONFIG_FILE --verb 6
2022-01-24 06:05:44.703561 [STATUS] (StatusMajor.CONNECTION, StatusMinor.CFG_OK) config_path=/net/openvpn/v3/configuration/69592c61x7aa8x41c1x8343x6de28437c2ee
2022-01-24 06:05:44.703664 [LOG] Starting connection
2022-01-24 06:05:44.703722 [LOG] Username/password provided successfully for 'matt'
2022-01-24 06:05:44.703784 [LOG] Using DNS resolver scope: global
2022-01-24 06:05:44.703941 [LOG] [Connect] DCO flag: disabled
2022-01-24 06:05:44.703995 [STATUS] (StatusMajor.CONNECTION, StatusMinor.CONN_CONNECTING)
2022-01-24 06:05:44.704035 [LOG] OpenVPN core 3.git:HEAD:7765540e linux x86_64 64-bit OVPN-DCO
2022-01-24 06:05:44.704058 [LOG] Frame=512/2048/512 mssfix-ctrl=1250
2022-01-24 06:05:44.704091 [LOG] UNUSED OPTIONS
9 [persist-tun]
14 [verb] [6]
2022-01-24 06:05:44.704124 [LOG] Resolving
2022-01-24 06:05:44.704150 [LOG] Contacting ----:443 via TCPv4
2022-01-24 06:05:44.704165 [LOG] Waiting for server response
2022-01-24 06:05:44.787373 [LOG] Connecting to [----]:443 (----) via TCPv4
2022-01-24 06:05:44.865541 [LOG] Connecting
2022-01-24 06:05:44.865703 [STATUS] (StatusMajor.CONNECTION, StatusMinor.CONN_CONNECTING)
2022-01-24 06:05:44.865802 [LOG] Tunnel Options:V4,dev-type tun,link-mtu 1560,tun-mtu 1500,proto TCPv4_CLIENT,comp-lzo,cipher AES-128-CBC,auth SHA1,keysize 128,key-method 2,tls-client
2022-01-24 06:05:44.865913 [LOG] Creds: Username/Password
2022-01-24 06:05:44.866212 [LOG] Peer Info:
IV_VER=3.git:HEAD:7765540e
IV_PLAT=linux
IV_NCP=2
IV_TCPNL=1
IV_PROTO=30
IV_CIPHERS=AES-128-GCM:AES-192-GCM:AES-256-GCM:CHACHA20-POLY1305
IV_LZO_STUB=1
IV_COMP_STUB=1
IV_COMP_STUBv2=1
IV_GUI_VER=OpenVPN 3/Linux v17_beta/3.git:HEAD:7765540e linux x86_64 64-bit
IV_SSO=openurl,webauth
2022-01-24 06:05:45.021026 [LOG] VERIFY OK: depth=1, /C=us/L=Philadelphia/O=Fieldworks LLC/CN=Fieldworks LLC VPN CA/emailAddress=aws_fieldworks@cloudnexa.com, signature: RSA-SHA256
2022-01-24 06:05:45.021532 [LOG] VERIFY OK: depth=0, /C=us/L=Philadelphia/O=Fieldworks LLC/CN=prd-vpn-a01/emailAddress=aws_fieldworks@cloudnexa.com, signature: RSA-SHA256
2022-01-24 06:05:45.399243 [LOG] SSL Handshake: peer certificate: CN=prd-vpn-a01, 2048 bit RSA, cipher: DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(256) Mac=AEAD
2022-01-24 06:05:45.399664 [LOG] Session is ACTIVE
2022-01-24 06:05:45.400066 [LOG] Retrieving configuration from server
2022-01-24 06:05:45.400255 [LOG] Sending PUSH_REQUEST to server...
2022-01-24 06:05:46.399302 [LOG] Sending PUSH_REQUEST to server...
2022-01-24 06:05:48.398816 [LOG] Sending PUSH_REQUEST to server...
2022-01-24 06:05:48.564080 [LOG] OPTIONS:
0 [route] [remote_host] [255.255.255.255] [net_gateway]
1 [route-gateway] [10.242.0.1]
2 [route-gateway] [10.242.0.1]
3 [topology] [subnet]
4 [ping] [10]
5 [ping-restart] [120]
6 [route] [10.50.0.0] [255.255.0.0]
7 [ifconfig] [10.242.0.3] [255.255.255.0]
2022-01-24 06:05:48.564469 [LOG] PROTOCOL OPTIONS:
cipher: AES-128-CBC
digest: SHA1
key-derivation: OpenVPN PRF
compress: LZO_STUB
peer ID: -1
2022-01-24 06:05:48.577730 [LOG] exception parsing IPv4 route: [route] [remote_host] [255.255.255.255] [net_gateway] : addr_pair_mask_parse_error: AddrMaskPair parse error 'route': remote_host/255.255.255.255 : ip_exception: error parsing route IP address 'remote_host' : Invalid argument
2022-01-24 06:05:48.579696 [LOG] Session name: '----'
2022-01-24 06:05:48.585909 [LOG] TunPersist: saving tun context:
Session Name: ----
Layer: OSI_LAYER_3
Remote Address: ----
Tunnel Addresses:
10.242.0.3/24 -> 10.242.0.1
Reroute Gateway: IPv4=0 IPv6=0 flags=[ IPv4 ]
Block IPv4: no
Block IPv6: no
Add Routes:
10.50.0.0/16
Exclude Routes:
DNS Servers:
Search Domains:
2022-01-24 06:05:48.585997 [LOG] Connected via tun
2022-01-24 06:05:48.586013 [LOG] Client exception in transport_recv: crypto_alg: AES-128-CBC: bad cipher for data channel use
2022-01-24 06:05:48.586026 [LOG] Client terminated, restarting in 2000 ms...
2022-01-24 06:05:50.583694 [LOG] Contacting ----:443 via TCPv4
2022-01-24 06:05:50.583950 [LOG] Waiting for server response
2022-01-24 06:05:50.666671 [LOG] Connecting to [----]:443 (----) via TCPv4
2022-01-24 06:05:50.743938 [LOG] Connecting
2022-01-24 06:05:50.744106 [STATUS] (StatusMajor.CONNECTION, StatusMinor.CONN_CONNECTING)
2022-01-24 06:05:50.745295 [LOG] Tunnel Options:V4,dev-type tun,link-mtu 1560,tun-mtu 1500,proto TCPv4_CLIENT,comp-lzo,cipher AES-128-CBC,auth SHA1,keysize 128,key-method 2,tls-client
2022-01-24 06:05:50.745476 [LOG] Creds: Username/Password
2022-01-24 06:05:50.745588 [LOG] Peer Info:
IV_VER=3.git:HEAD:7765540e
IV_PLAT=linux
IV_NCP=2
IV_TCPNL=1
IV_PROTO=30
IV_CIPHERS=AES-128-GCM:AES-192-GCM:AES-256-GCM:CHACHA20-POLY1305
IV_LZO_STUB=1
IV_COMP_STUB=1
IV_COMP_STUBv2=1
IV_GUI_VER=OpenVPN 3/Linux v17_beta/3.git:HEAD:7765540e linux x86_64 64-bit
IV_SSO=openurl,webauth
2022-01-24 06:05:50.928049 [LOG] VERIFY OK: depth=1, /C=us/L=Philadelphia/O=Fieldworks LLC/CN=Fieldworks LLC VPN CA/emailAddress=aws_fieldworks@cloudnexa.com, signature: RSA-SHA256
2022-01-24 06:05:50.928181 [LOG] VERIFY OK: depth=0, /C=us/L=Philadelphia/O=Fieldworks LLC/CN=prd-vpn-a01/emailAddress=aws_fieldworks@cloudnexa.com, signature: RSA-SHA256
2022-01-24 06:05:51.296520 [LOG] SSL Handshake: peer certificate: CN=prd-vpn-a01, 2048 bit RSA, cipher: DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(256) Mac=AEAD
2022-01-24 06:05:51.296695 [LOG] Session is ACTIVE
2022-01-24 06:05:51.296798 [LOG] Retrieving configuration from server
2022-01-24 06:05:51.296964 [LOG] Sending PUSH_REQUEST to server...
2022-01-24 06:05:51.471833 [LOG] OPTIONS:
0 [route] [remote_host] [255.255.255.255] [net_gateway]
1 [route-gateway] [10.242.0.1]
2 [route-gateway] [10.242.0.1]
3 [topology] [subnet]
4 [ping] [10]
5 [ping-restart] [120]
6 [route] [10.50.0.0] [255.255.0.0]
7 [ifconfig] [10.242.0.3] [255.255.255.0]
2022-01-24 06:05:51.472008 [LOG] PROTOCOL OPTIONS:
cipher: AES-128-CBC
digest: SHA1
key-derivation: OpenVPN PRF
compress: LZO_STUB
peer ID: -1
2022-01-24 06:05:51.472288 [LOG] TunPersist: reused tun context
2022-01-24 06:05:51.472378 [LOG] Connected via tun
2022-01-24 06:05:51.472458 [LOG] Client exception in transport_recv: crypto_alg: AES-128-CBC: bad cipher for data channel use
2022-01-24 06:05:51.472667 [LOG] Client terminated, restarting in 2000 ms...
retries...
There are multiple issues here.
First of all, with DCO you cannot enable legacy algorithms. The ovpn-dco
kernel module only supports AEAD ciphers (AES-GCM and ChaCha20-Poly1305). There are no exception here.
The log file you provide at the end has a single line which is the key issue:
Client exception in transport_recv: crypto_alg: AES-128-CBC: bad cipher for data channel use
The openpn2
front-end doesn't support changing the enable-legacy-algorithms
override. But as you have done the openvpn3 config-import
step, it's possible to increase the log level there and extract that without too much extra work.
openvpn3 config-manage --config CONFIG_NAME --log-level 6 --enable-legacy-algorithms true --show
openvpn3 log --config CONFIG_NAME
openvpn3 session-start --config CONFIG_NAME
Hello,
After upgrading, I had the same issue here, with the 17~beta2
version. I had to rollback to 15~beta
on my Ubuntu 20.04.3 to make openvpn3
command work again:
sudo apt-get install openvpn3=15~beta+focal
After upgrading, I had the same issue here, with the
17~beta2
version. I had to rollback to15~beta
on my Ubuntu 20.04.3 to makeopenvpn3
command work again:
Hi @alexandre-lelain,
It would help tremendously if you would bother enough to do the same debugging steps already discussed here in prior comments and provide log details. Rolling back two releases shouldn't be needed unless there are some real issues. And we need to understand those issues better, which requires logs.
Hello @dsommers ,
After some investigations, it seems that enabling --enable-legacy-algorithms true
in my config resolved my problem with version 17~beta2+focal
.
So I guess the ssh server I'm trying to connect to does not support AEAD cipher, and that was probably a default support in versions prior to this one. Which may explain why upgrading to v17 broke my connection as the legacy algorithms were not enabled.
@alexandre-lelain Which OS/distro is your VPN server running? And which version of OpenVPN? As of OpenVPN 2.4 on most Linux distributions, AEAD ciphers should not be a problem (you need OpenSSL 1.0.1 or newer). In addition, OpenVPN 2.4 and newer should automatically negotiate an AEAD cipher unless this mechanism has been disabled.
AEAD ciphers supported in OpenVPN today are AES-GCM and ChaCha20-Poly1305, but it requires support from the OpenSSL library as well.
If you are running an OS or Linux distribution with an OpenSSL library older than version 1.0.1 or have an OpenVPN version older than 2.4, you should upgrade.
There are multiple issues here.
First of all, with DCO you cannot enable legacy algorithms. The
ovpn-dco
kernel module only supports AEAD ciphers (AES-GCM and ChaCha20-Poly1305). There are no exception here.The log file you provide at the end has a single line which is the key issue:
Client exception in transport_recv: crypto_alg: AES-128-CBC: bad cipher for data channel use
The
openpn2
front-end doesn't support changing theenable-legacy-algorithms
override. But as you have done theopenvpn3 config-import
step, it's possible to increase the log level there and extract that without too much extra work.1. Increase the default log-level and enable legacy algorithms for the config profile: `openvpn3 config-manage --config CONFIG_NAME --log-level 6 --enable-legacy-algorithms true --show` 2. In terminal A, start a log capture process: `openvpn3 log --config CONFIG_NAME` 3. In terminal B, start the VPN session: `openvpn3 session-start --config CONFIG_NAME`
Hi @mattc321,
Have you had a chance to look into this?
Closing this as it looks quite similar to #91.
Further, the server does not seem to support NCP, which would normally upgrade the tunnel to an AEAD cipher (usually AES-256-GCM
). This is seen in the log snipped below; the server does not push any cipher
options.
2022-01-24 06:05:45.400066 [LOG] Retrieving configuration from server
2022-01-24 06:05:45.400255 [LOG] Sending PUSH_REQUEST to server...
2022-01-24 06:05:46.399302 [LOG] Sending PUSH_REQUEST to server...
2022-01-24 06:05:48.398816 [LOG] Sending PUSH_REQUEST to server...
2022-01-24 06:05:48.564080 [LOG] OPTIONS:
0 [route] [remote_host] [255.255.255.255] [net_gateway]
1 [route-gateway] [10.242.0.1]
2 [route-gateway] [10.242.0.1]
3 [topology] [subnet]
4 [ping] [10]
5 [ping-restart] [120]
6 [route] [10.50.0.0] [255.255.0.0]
7 [ifconfig] [10.242.0.3] [255.255.255.0]
2022-01-24 06:05:48.564469 [LOG] PROTOCOL OPTIONS:
cipher: AES-128-CBC
digest: SHA1
key-derivation: OpenVPN PRF
compress: LZO_STUB
peer ID: -1
This indicates that the AES-128-CBC
cipher is kept, but the OpenSSL library does not allow this cipher as legacy ciphers are not enabled.
After upgrading, client attempts to connect over and over with no failure. Hangs and repeats connecting. Tried with dco feature, similar results. Tried with --enable-legacy-algorithms true, no change.
Related issues: #91 #94 #102
Workaround fix: downgrade to version 16
Version and System Info
Client Config
Without dco or weak ciphers config
log
With dco and weak ciphers enabled config
log
Not looking for an update on this issue - just posting this in case it will help.