State reconnecting tls error tls

We are facing strange issue with OpenVPN since morning. Still yesterday, it was working fine. I am getting below error.I tried to connect by bypassing my Sonicwall Firewall but no success.

We are facing strange issue with OpenVPN since morning. Still yesterday, it was working fine. I am getting below error.I tried to connect by bypassing my Sonicwall Firewall but no success.

Thu Feb 05 00:12:26 2015 OpenVPN 2.3.4 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [IPv6] built on Aug 7 2014
Thu Feb 05 00:12:26 2015 library versions: OpenSSL 1.0.1i 6 Aug 2014, LZO 2.05
Thu Feb 05 00:12:26 2015 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Thu Feb 05 00:12:26 2015 Need hold release from management interface, waiting…
Thu Feb 05 00:12:27 2015 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Thu Feb 05 00:12:27 2015 MANAGEMENT: CMD ‘state on’
Thu Feb 05 00:12:27 2015 MANAGEMENT: CMD ‘log all on’
Thu Feb 05 00:12:27 2015 MANAGEMENT: CMD ‘hold off’
Thu Feb 05 00:12:27 2015 MANAGEMENT: CMD ‘hold release’
Thu Feb 05 00:12:31 2015 MANAGEMENT: CMD ‘password […]’
Thu Feb 05 00:12:31 2015 WARNING: this configuration may cache passwords in memory — use the auth-nocache option to prevent this
Thu Feb 05 00:12:31 2015 SIGUSR1[soft,private-key-password-failure] received, process restarting
Thu Feb 05 00:12:31 2015 MANAGEMENT: >STATE:1423051951,RECONNECTING,private-key-password-failure,,
Thu Feb 05 00:12:31 2015 Restart pause, 2 second(s)
Thu Feb 05 00:12:37 2015 MANAGEMENT: CMD ‘password […]’
Thu Feb 05 00:12:37 2015 Control Channel Authentication: using ‘ta.key’ as a OpenVPN static key file
Thu Feb 05 00:12:37 2015 Outgoing Control Channel Authentication: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Thu Feb 05 00:12:37 2015 Incoming Control Channel Authentication: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Thu Feb 05 00:12:37 2015 Socket Buffers: R=[65536->65536] S=[65536->65536]
Thu Feb 05 00:12:37 2015 MANAGEMENT: >STATE:1423051957,RESOLVE,,,
Thu Feb 05 00:12:38 2015 UDPv4 link local: [undef]
Thu Feb 05 00:12:38 2015 UDPv4 link remote: [AF_INET]XX.XXX.XX.XX:1194
Thu Feb 05 00:12:38 2015 MANAGEMENT: >STATE:1423051958,WAIT,,,
Thu Feb 05 00:13:38 2015 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Thu Feb 05 00:13:38 2015 TLS Error: TLS handshake failed
Thu Feb 05 00:13:38 2015 SIGUSR1[soft,tls-error] received, process restarting
Thu Feb 05 00:13:38 2015 MANAGEMENT: >STATE:1423052018,RECONNECTING,tls-error,,
Thu Feb 05 00:13:38 2015 Restart pause, 2 second(s)

Anybody has faced similar kind of issue?. Please help me which possible solutions.

Thank you in Advance:)

Everything works ok on Ubuntu 16.04, but I can’t connect to my server from Windows 10, using official openvpn app. Firewall is disabled both on server and client.

———-Here is the log———-
Wed May 02 04:21:27 2018 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Wed May 02 04:21:27 2018 TLS Error: TLS handshake failed
Wed May 02 04:21:27 2018 SIGUSR1[soft,tls-error] received, process restarting
Wed May 02 04:21:27 2018 MANAGEMENT: >STATE:1525224087,RECONNECTING,tls-error,,,,,
Wed May 02 04:21:27 2018 Restart pause, 5 second(s)
Wed May 02 04:21:32 2018 TCP/UDP: Preserving recently used remote address: [AF_INET]95.216.140.175:1194
Wed May 02 04:21:32 2018 Socket Buffers: R=[65536->65536] S=[65536->65536]
Wed May 02 04:21:32 2018 UDP link local: (not bound)
Wed May 02 04:21:32 2018 UDP link remote: [AF_INET]95.216.140.175:1194
Wed May 02 04:21:32 2018 MANAGEMENT: >STATE:1525224092,WAIT,,,,,,
Wed May 02 04:22:32 2018 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Wed May 02 04:22:32 2018 TLS Error: TLS handshake failed
Wed May 02 04:22:32 2018 SIGUSR1[soft,tls-error] received, process restarting
Wed May 02 04:22:32 2018 MANAGEMENT: >STATE:1525224152,RECONNECTING,tls-error,,,,,
Wed May 02 04:22:32 2018 Restart pause, 5 second(s)
Wed May 02 04:22:37 2018 TCP/UDP: Preserving recently used remote address: [AF_INET]95.216.140.175:1194
Wed May 02 04:22:37 2018 Socket Buffers: R=[65536->65536] S=[65536->65536]
Wed May 02 04:22:37 2018 UDP link local: (not bound)
Wed May 02 04:22:37 2018 UDP link remote: [AF_INET]95.216.140.175:1194
Wed May 02 04:22:37 2018 MANAGEMENT: >STATE:1525224157,WAIT,,,,,,
Wed May 02 04:22:39 2018 write UDP: Unknown error (code=10051)

———-Here is my .ovpn file’s content———-
client
proto udp
remote 95.216.140.175 1194
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_XtJrEMJvSsZ98eJT name
auth SHA256
auth-nocache
cipher AES-128-CBC
tls-client
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-128-GCM-SHA256
setenv opt block-outside-dns
verb 3
script-security 2
dhcp-option DNS 213.133.100.100
dhcp-option DNS 213.133.98.98
dhcp-option DNS 213.133.99.99

Please, help to solve this problem.

Доброго времени суток! Впервые сталкиваюсь с технологией OpenVPN, yе смог найти ответа на просторах всемирной сети по сложившейся проблеме, прошу помощи!
Ситуация такая:
на машине с Windows 7 64 bit развернута VirtualBox с Ubuntu 16.04 Server, сетевая карта установлена в VB в режим сетевого моста. Таким образом хостовая машина и виртуалка видят друг друга (адрес хоста 10.80.2.107, адрес виртуалки 10.80.2.133).
На VB развернут openvpn сервер а также Удостоверяющий центр, настройка производилась в соотв. с инструкцией http://howitmake.ru/blog/ubuntu/192.html. На машине с Windows установлен openvpn клиент. Подключиться с клиента не удается. Логи во вложении. Пробовал переиздать ключи неоднократно, также проверял не блокирует ли Ubuntu сетевые пакеты — tcpdump показывает прохождение как входящих так и исходящих пакетов. Уже не знаю куда копать.
сlient.txt — конфиг клиента
server.txt — конфиг сервера


Пользователь добавил сообщение 06 Февраля 2017, 13:12:55:


Извиняюсь, не разобрался как корректно крепить файлы. Прикладываю лог клиента и лог сервера.
В логе сервера:
Mon Feb  6 16:29:52 2017 us=728532 10.80.2.107:56123 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Mon Feb  6 16:29:52 2017 us=728665 10.80.2.107:56123 TLS Error: TLS handshake failed
Mon Feb  6 16:29:52 2017 us=728847 10.80.2.107:56123 Fatal TLS error (check_tls_errors_co), restarting

Лог клиента:
Mon Feb 06 15:54:09 2017 OpenVPN 2.4.0 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Dec 27 2016
Mon Feb 06 15:54:09 2017 Windows version 6.1 (Windows 7) 64bit
Mon Feb 06 15:54:09 2017 library versions: OpenSSL 1.0.2i  22 Sep 2016, LZO 2.09
Enter Management Password:
Mon Feb 06 15:54:09 2017 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Mon Feb 06 15:54:09 2017 Need hold release from management interface, waiting…
Mon Feb 06 15:54:09 2017 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Mon Feb 06 15:54:09 2017 MANAGEMENT: CMD ‘state on’
Mon Feb 06 15:54:09 2017 MANAGEMENT: CMD ‘log all on’
Mon Feb 06 15:54:09 2017 MANAGEMENT: CMD ‘hold off’
Mon Feb 06 15:54:09 2017 MANAGEMENT: CMD ‘hold release’
Mon Feb 06 15:54:09 2017 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Mon Feb 06 15:54:09 2017 Outgoing Control Channel Authentication: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Mon Feb 06 15:54:09 2017 Incoming Control Channel Authentication: Using 160 bit message hash ‘SHA1’ for HMAC authentication
Mon Feb 06 15:54:09 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]10.80.2.133:1988
Mon Feb 06 15:54:09 2017 Socket Buffers: R=[8192->8192] S=[8192->8192]
Mon Feb 06 15:54:09 2017 Attempting to establish TCP connection with [AF_INET]10.80.2.133:1988 [nonblock]
Mon Feb 06 15:54:09 2017 MANAGEMENT: >STATE:1486371249,TCP_CONNECT,,,,,,
Mon Feb 06 15:54:09 2017 TCP connection established with [AF_INET]10.80.2.133:1988
Mon Feb 06 15:54:09 2017 TCP_CLIENT link local: (not bound)
Mon Feb 06 15:54:09 2017 TCP_CLIENT link remote: [AF_INET]10.80.2.133:1988
Mon Feb 06 15:54:09 2017 MANAGEMENT: >STATE:1486371249,WAIT,,,,,,
Mon Feb 06 15:54:10 2017 MANAGEMENT: >STATE:1486371250,AUTH,,,,,,
Mon Feb 06 15:54:10 2017 TLS: Initial packet from [AF_INET]10.80.2.133:1988, sid=446d4ca1 c9ed60d4
Mon Feb 06 15:54:11 2017 VERIFY OK: depth=1, CN=vpnserver
Mon Feb 06 15:54:11 2017 VERIFY OK: depth=0, CN=vpnserver
Mon Feb 06 15:55:09 2017 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Mon Feb 06 15:55:09 2017 TLS Error: TLS handshake failed
Mon Feb 06 15:55:09 2017 Fatal TLS error (check_tls_errors_co), restarting
Mon Feb 06 15:55:09 2017 SIGUSR1[soft,tls-error] received, process restarting
Mon Feb 06 15:55:09 2017 MANAGEMENT: >STATE:1486371309,RECONNECTING,tls-error,,,,,
Mon Feb 06 15:55:09 2017 Restart pause, 5 second(s)
Mon Feb 06 15:55:12 2017 SIGTERM[hard,init_instance] received, process exiting
Mon Feb 06 15:55:12 2017 MANAGEMENT: >STATE:1486371312,EXITING,init_instance,,,,,

Всем привет!
У меня есть VPN провайдер, премиум аккаунт. В настройках аккаунта я скачиваю файл настроек ***.ovpn. Кидаю его по пути C:Program FilesOpenVPNconfig и подключаюсь через openvpn.
А теперь не подключается. Зависает вот на этой строчке:
Fri Nov 21 09:17:38 2014 UDPv4 link local: [undef]
Fri Nov 21 09:16:36 2014 UDPv4 link remote: [AF_INET]***IP***:443
Fri Nov 21 09:16:36 2014 MANAGEMENT: >STATE:1416550596,WAIT

А затем ошибка:
Thu Nov 20 16:40:37 2014 us=227044 MANAGEMENT: >STATE:1416490837,WAIT,,,
Thu Nov 20 16:41:37 2014 us=403575 [UNDEF] Inactivity timeout (—ping-exit), exiting
Thu Nov 20 16:41:37 2014 us=403575 SIGTERM received, sending exit notification to peer
Thu Nov 20 16:41:37 2014 us=403575 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Thu Nov 20 16:41:37 2014 us=403575 TLS Error: TLS handshake failed
Thu Nov 20 16:41:37 2014 us=403575 TCP/UDP: Closing socket
Thu Nov 20 16:41:37 2014 us=403575 SIGUSR1[soft,tls-error] received, process restarting
Thu Nov 20 16:41:37 2014 us=403575 MANAGEMENT: >STATE:1416490897,RECONNECTING,tls-error,,

И это не со всеми ip ошибка. С некоторыми нормально подключается.
Но проблема не на стороне моего VPN поставщика, как мне кажется.

Даже если полностю вырубить интернет на пк и попытаться через openvpn подключиться, то с работающим ip будет такая запись:
Fri Nov 21 09:22:18 2014 us=418789 MANAGEMENT: >STATE:1416550938,RESOLVE,,,
Fri Nov 21 09:22:18 2014 us=418789 RESOLVE: Cannot resolve host address: ***ip***: Запрошенное имя верно, но данные запрошенного типа не найдены.

А с неработающим ip такая же ошибка:
Fri Nov 21 09:23:48 2014 us=552944 MANAGEMENT: >STATE:1416551028,WAIT,,
так же думает на этом месте. И ошибка:
Fri Nov 21 09:24:49 2014 us=225415 [UNDEF] Inactivity timeout (—ping-exit), exiting
Fri Nov 21 09:24:49 2014 us=225415 SIGTERM received, sending exit notification to peer
Fri Nov 21 09:24:49 2014 us=225415 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri Nov 21 09:24:49 2014 us=225415 TLS Error: TLS handshake failed
Fri Nov 21 09:24:49 2014 us=225415 TCP/UDP: Closing socket
Fri Nov 21 09:24:49 2014 us=226415 SIGUSR1[soft,tls-error] received, process restarting
Fri Nov 21 09:24:49 2014 us=226415 MANAGEMENT: >STATE:1416551089,RECONNECTING,tls-error,,

В чем может быть дело?

Hey!

I have a strange problem. The same setup was working for months, nothing changed. Perhaps it`s due to an update and you guys can help me. I can`t establish a vpn connection to our openvpn server any more.

I`m using tunnelblick as vpn client to connect from my mac to the office. It hangs at «waiting for response from server». I`m not an expert, but as I understand the tls handshake fails. I googled around and tried everything suggested, but no success.

I haven`t used it since the latest openvpn package update, perhaps it has something to do with that?

I found this, too, but it didn`t help either:
http://openvpn.net/index.php/open-sourc … ivity.html

This is the client log:

2013-02-16 11:17:06 MANAGEMENT: >STATE:1361009826,WAIT,,,
2013-02-16 11:18:06 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
2013-02-16 11:18:06 TLS Error: TLS handshake failed
2013-02-16 11:18:06 TCP/UDP: Closing socket
2013-02-16 11:18:06 SIGUSR1[soft,tls-error] received, process restarting
2013-02-16 11:18:06 MANAGEMENT: >STATE:1361009886,RECONNECTING,tls-error,,
2013-02-16 11:18:06 MANAGEMENT: CMD 'hold release'

and this is the server log (verbose 5):

Sat Feb 16 11:38:08 2013 us=118721 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Sat Feb 16 11:38:08 2013 us=133716 Diffie-Hellman initialized with 2048 bit key
Sat Feb 16 11:38:08 2013 us=134619 Control Channel Authentication: using '/etc/openvpn/keys/ta.key' as a OpenVPN static key file
Sat Feb 16 11:38:08 2013 us=134677 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Feb 16 11:38:08 2013 us=134707 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Feb 16 11:38:08 2013 us=134745 TLS-Auth MTU parms [ L:1590 D:166 EF:66 EB:0 ET:0 EL:0 ]
Sat Feb 16 11:38:08 2013 us=134808 Socket Buffers: R=[212992->131072] S=[212992->131072]
Sat Feb 16 11:38:08 2013 us=135268 TUN/TAP device tap0 opened
Sat Feb 16 11:38:08 2013 us=135370 TUN/TAP TX queue length set to 100
Sat Feb 16 11:38:08 2013 us=135572 Data Channel MTU parms [ L:1590 D:1450 EF:58 EB:135 ET:32 EL:0 AF:3/1 ]
Sat Feb 16 11:38:08 2013 us=137116 UDPv4 link local (bound): [undef]
Sat Feb 16 11:38:08 2013 us=137832 UDPv4 link remote: [undef]
Sat Feb 16 11:38:08 2013 us=137870 MULTI: multi_init called, r=256 v=256
Sat Feb 16 11:38:08 2013 us=138013 IFCONFIG POOL: base=192.168.1.220 size=10, ipv6=0
Sat Feb 16 11:38:08 2013 us=138087 Initialization Sequence Completed
Sat Feb 16 11:38:22 2013 us=273924 MULTI: multi_create_instance called
Sat Feb 16 11:38:22 2013 us=274097 192.168.1.4:1194 Re-using SSL/TLS context
Sat Feb 16 11:38:22 2013 us=274189 192.168.1.4:1194 LZO compression initialized
Sat Feb 16 11:38:22 2013 us=274539 192.168.1.4:1194 Control Channel MTU parms [ L:1590 D:166 EF:66 EB:0 ET:0 EL:0 ]
Sat Feb 16 11:38:22 2013 us=274643 192.168.1.4:1194 Data Channel MTU parms [ L:1590 D:1450 EF:58 EB:135 ET:32 EL:0 AF:3/1 ]
Sat Feb 16 11:38:22 2013 us=274701 192.168.1.4:1194 Local Options String: 'V4,dev-type tap,link-mtu 1590,tun-mtu 1532,proto UDPv4,comp-lzo,keydir 0,cipher AES-128-CBC,auth SHA1,keysize 128,tls-auth,key-method 2,tls-server'
Sat Feb 16 11:38:22 2013 us=274717 192.168.1.4:1194 Expected Remote Options String: 'V4,dev-type tap,link-mtu 1590,tun-mtu 1532,proto UDPv4,comp-lzo,keydir 1,cipher AES-128-CBC,auth SHA1,keysize 128,tls-auth,key-method 2,tls-client'
Sat Feb 16 11:38:22 2013 us=274745 192.168.1.4:1194 Local Options hash (VER=V4): 'c5677ab3'
Sat Feb 16 11:38:22 2013 us=274765 192.168.1.4:1194 Expected Remote Options hash (VER=V4): 'a7133b47'
RSat Feb 16 11:38:22 2013 us=275000 192.168.1.4:1194 TLS: Initial packet from [AF_INET]192.168.1.4:1194 (via [AF_INET]192.168.1.205%br0), sid=e46fc8e5 4b4327b5
WSat Feb 16 11:38:22 2013 us=275121 192.168.1.4:1194 write UDPv4: Invalid argument (code=22)
RWSat Feb 16 11:38:24 2013 us=597178 192.168.1.4:1194 write UDPv4: Invalid argument (code=22)
RWSat Feb 16 11:38:28 2013 us=80376 192.168.1.4:1194 write UDPv4: Invalid argument (code=22)
RWSat Feb 16 11:38:36 2013 us=360017 192.168.1.4:1194 write UDPv4: Invalid argument (code=22)
WSat Feb 16 11:38:52 2013 us=266108 192.168.1.4:1194 write UDPv4: Invalid argument (code=22)
RWSat Feb 16 11:38:52 2013 us=284681 192.168.1.4:1194 write UDPv4: Invalid argument (code=22)
RSat Feb 16 11:39:22 2013 us=604136 192.168.1.4:1194 TLS: new session incoming connection from [AF_INET]192.168.1.4:1194 (via [AF_INET]192.168.1.205%br0)
Sat Feb 16 11:39:22 2013 us=604198 192.168.1.4:1194 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Sat Feb 16 11:39:22 2013 us=604219 192.168.1.4:1194 TLS Error: TLS handshake failed

This is the server config. It`s located in /etc/openvpn/openvpn_server.conf and the server starts fine with systemctl start openvpn@openvpn_server.service.

mode server
dev tap0
multihome
server-bridge 192.168.1.205 255.255.255.0 192.168.1.220 192.168.1.229
client-to-client

proto udp
port 1194
comp-lzo

persist-tun
persist-key
keepalive 10 120

 ca /etc/openvpn/keys/ca.crt
 dh /etc/openvpn/keys/dh2048.pem
 cert /etc/openvpn/keys/archvpn.crt
 key /etc/openvpn/keys/archvpn.key
 tls-auth /etc/openvpn/keys/ta.key 0
 tls-server

verb 3
cipher AES-128-CBC

log      /etc/openvpn/openvpn.log

This is the client config:

client
remote myserver.dyndns.org 1194
dev tap0

proto udp
port 1194
comp-lzo
ca ca.crt 
cert tom.crt 
key tom.key

persist-tun
persist-key
resolv-retry infinite
keepalive 10 120

tls-auth ta.key 1
tls-client
ns-cert-type server

verb 3
cipher AES-128-CBC
float

What I checked and tried so far:
0    did a lot of reading

1    modules are loaded in /etc/modules-load.d/openvpn.conf
tun
bridge

2 netcfg config starts tap and network config

/etc/conf.d/netcfg
NETWORKS=(openvpn_tap office_lan_openvpn)

/etc/network.d/openvpn_tap
INTERFACE='tap0'
CONNECTION='tuntap'
MODE='tap'
USER='nobody'
GROUP='nobody'

/etc/network.d/office_lan_openvpn
INTERFACE="br0"
CONNECTION="bridge"
DESCRIPTION="Ethernet/OpenVPN bridge"
BRIDGE_INTERFACES="eth0 tap0"
IP="static"
ADDR="192.168.1.205"
GATEWAY="192.168.2.1"
DNS=("192.168.1.1")

3    checked firewall port, even disabled iptables

4    port forwarding in fritzbox is active

5    all other connections from outside are working (http, ftp)

6    certificates and keys should be fine, they were working in the past with the same setup

Hope someone can help me, I really need my connection back… If anything else is needed just let me know.

Last edited by archtom (2013-02-16 16:08:21)

This topic has been deleted. Only users with topic management privileges can see it.

  • I’m having issues with my OpenVPN site configurations after upgrading to 2.5.0 (reproduced on two pfsense boxes). I previously have not had any issues while upgrading with previous pfsense versions. It seems that certificate verification may be broken or working differently in 2.5.0 — I can connect successfully only after disabling certificate verification.

    For my setup, I have a self-signed root CA, intermediate CA (signed by the root CA), and server/user certificates (signed by the intermediate CA). The root CA, intermediate CA, and server/user certificates are all imported into pfsense. My certificate depth verification is set to Two (Client+Intermediate+Server). The peer certificate authority is set to the intermediate CA. I get the following logs when attempting to connect from a client (as well as a pfsense to pfsense site-to-site setup):

    Feb 21 13:16:20	openvpn	99514	<user ip>:51909 VERIFY WARNING: depth=0, unable to get certificate CRL: <user cert>
    Feb 21 13:16:20	openvpn	99514	<user ip>:51909 VERIFY WARNING: depth=1, unable to get certificate CRL: <intermediate cert>
    Feb 21 13:16:20	openvpn	99514	<user ip>:51909 VERIFY WARNING: depth=2, unable to get certificate CRL: <root cert>
    Feb 21 13:16:20	openvpn	99514	<user ip>:51909 VERIFY SCRIPT OK: depth=2, <root cert>
    Feb 21 13:16:20	openvpn	99514	<user ip>:51909 VERIFY OK: depth=2, <root cert>
    Feb 21 13:16:20	openvpn	99514	<user ip>:51909 WARNING: Failed running command (--tls-verify script): external program exited with error status: 1
    Feb 21 13:16:20	openvpn	99514	<user ip>:51909 VERIFY SCRIPT ERROR: depth=1, <intermediate cert>
    Feb 21 13:16:21	openvpn	99514	<user ip>:51909 SSL alert (write): fatal: unknown CA
    Feb 21 13:16:21	openvpn	99514	<user ip>:51909 OpenSSL: error:1417C086:SSL routines:tls_process_client_certificate:certificate verify failed
    Feb 21 13:16:21	openvpn	99514	<user ip>:51909 TLS_ERROR: BIO read tls_read_plaintext error
    Feb 21 13:16:21	openvpn	99514	<user ip>:51909 TLS Error: TLS object -> incoming plaintext read error
    Feb 21 13:16:21	openvpn	99514	<user ip>:51909 TLS Error: TLS handshake failed
    

    It seems like there is a verification of the intermediate CA at depth=1 which fails with unknown CA. I’m not sure what is normally done in previous versions of pfsense.

  • @joshh
    I have observed same failure to connect after updating to pfsense 21.02 and OpenVPN 2.5.0. I also use a similar setup where I have a self generated root CA, intermediate CA with server/client certs signed by the intermediate CA.

    I don’t have a copy of the previous openvpn server config generated by pfsense, but it appears that pfsense enabled an additional feature tls-verify that wasn’t used in previous version of pfsense. After upgrading pfsense, the «Certificate Depth» option was set to «Two (Client + Intermediate + Server)».

    This results in following config line in the generated config file /var/etc/openvpn/server1/config.ovpn:

    tls-verify «/usr/local/sbin/ovpn_auth_verify tls ‘myhostname.mydomain.com’ 2»

    One would have thought this would work since both client and server are signed by the same intermediate cert. But as with your failure, the script returns a non zero value causing openvpn to fail the connection. The script «/usr/local/sbin/ovpn_auth_verify» appears to be maintained by pfsense.

    I’ve not yet spent anytime troubleshooting the script «/usr/local/sbin/ovpn_auth_verify» to determine why it’s failing with my self generated root CA and intermediate cert. As a workaround, disabling «Certificate Depth» by setting to «Do Not Check» allows clients to connect until able to resolve why the tls-verify script is failing.

  • I think I may have found cause of failure. The tls-verify cmd calls «/usr/local/sbin/ovpn_auth_verify» which in turn calls following «/usr/local/sbin/fcgicli»

    The fifth arg ($5) to ovpn_auth_verify looks to be the subject of the root CA (passed by openvpn). I found that if the CN of the this subject contains a space (the last element of subject), the call to fcgicli fails with error message «Something wrong happened while reading request». I suspect that fcgicli fails the parsing of key value pairs if the last element of the subject contains a space. Adding some escapes/quotes to the command in «/usr/local/sbin/ovpn_auth_verify» seems to fix. If I set cert depth to 2 (or more) with fix applied, the RESULT is «OK» and passes. If I set to depth of 1, it fails as expected with «FAILED».

    > diff ovpn_auth_verify ovpn_auth_verify.fixed 
    27c27
    <               RESULT=$(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.tls-verify.php -d "servercn=$2&depth=$3&certdepth=$4&certsubject=$5&serial=$serial&config=$config")
    ---
    >               RESULT=$(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.tls-verify.php -d "servercn=$2&depth=$3&certdepth=$4&certsubject=\"$5\"&serial=$serial&config=$config")
    
  • Searching bug reports, seems that problem may be more of string length rather than whitespace in CN (my testing also confirms). The length of my subject name 137 chars which looks to be a little larger than length that causes problem per bug report.

    See bug report #10560 and #4521.

  • @gribnut ‘s fix didn’t work for me, however …

    For some reason, OpenVPN confuses things by having TWO clients: «OpenVPN Connect v3», (The one you download from openvpn.net), «OpenVPN GUI v11», which is what PFSense uses when you download the full client installer from «Client Export».

    Since some clients have more than one VPN profile they need to connect to, and not everyone is using PFSense with their fancy bundled deploy, I use the OpenVPN Connect client. It’s got a nicer UI that’s easier to use for the end-users plus has a nice traffic graph. It’s also the one readily downloadable from openvpn.net.

    PFSense seems to have broken the OpenVPN Connect client. If you use the crappy client PFSense bundles with Client Export it works for me.

  • @gribnut

    Same problem here, same fix as you suggested.
    CA CN is «Home CA» (note the space) and client is an old OpenVPN v2.3.4 (with the associated network-manager-openvpn plugin v0.9.10) on a Debian Jessie.
    pfSense v2.4.5p1 has no issue, upgraded to pfSense v2.5.0 it is impossible to connect with the «client certificate verification failed» error already reported in the starting post.
    Applied your fix (\"$5\" in the verification script) and everything works again as expected for the old Debian Jessie.

    Android phone with «OpenVPN for Android» v0.7.21 has no issue whatsoever, before or after the fix, thus the issue seems also related to the OpenVPN client used.
    For sure the /usr/local/sbin/ovpn_auth_verify script distributed with pfSense v2.5.0 is buggy: v2.4.5p1 had no problem at all.

  • @gribnut This fix seems to have solved a similar problem I have been having with TLS/SSL OpenVPN connections.
    Converted a stable 2.4.5p1 to 2.4.5p1 pair to 2.5.0 — 2.5.0 and lost the existing S2S OpenVPN link. I rebuilt the CA/Certs for Server and Client under 2.5.0 and got the link back.
    Later I realized the Server had a secondary RoadWarrior setup that was also now failing previously stable clients. Logs pointed to failure to find CA.
    Tried your fix and Voila it all came back to life.

    Looks like a definite bug here, what’s interesting is my CA common name has no spaces as far as I can tell.
    It’s «811pow-ovpn-rdwar-ca» although I’m not sure if there’s a leading space buried in there. I’ve used an OpenSSL command to dump the subject, but it’s not clear if the output adds a space to the entries as they are printed.

  • @divsys
    I was a bit off when I though was due to space as removing space appeared to fix problem. Looks like the root problem is length of string (all key value pairs) for -d arg to fcgicli. If combination of server hostname (as used by client), cert subject and serial number is too long, fcgicli bombs and returns «Something wrong happened while reading request». Guessing the length of various values in your environment also exceed what works for fcgicli.
    Looks like bug #4521 was reported some time ago and no indication of when will be fixed. I added comment to confirm it is still a problem in hopes it gets fixed in near future. Fortunately, I don’t have a dependency upon limiting cert depth.

  • @fr3ddie
    I forgot to mention that anytime you save openvpn config, it will write over any changes made to /usr/local/sbin/ovpn_auth_verify. I’ve not looked to see which file updates /usr/local/sbin/ovpn_auth_verify, so I just disabled cert depth check altogether until long arg to fcgicli is resolved.

    Just guessing, but suspect that reason one of your clients might work whereas as others don’t is due to length of cert subject for client. The tls_verify will iterate through entire chain (depending up configured depth to search). The length of string for subject (the entire subject not just CN) could end up causing arg passed to fcgiclie to exceed value that works.

  • @gribnut Thanks for your help in tracking this down. Makes me much more hopeful about converting up to 2.5.0.

  • @gribnut

    So, does disabling that depth check allow the VPN to work? Currently, I can get it to work on the same LAN, but not from outside the firewall.

  • @jknott
    Disabling depth check is only a workaround if the tls-verify script is failing. Won’t fix other problems. Recommend checking your logs to see cause of failure.

  • @gribnut Hmmmmm, I think there’s a bit more to this one than meets the eye.
    On ahunch, I backed out the code change to ovpn_auth_verify back to factory.

    Roadwarrior links still good

    Restarted the RoadWarror server process

    Roadwarrior links still good

    Rebooted the remote pfSense box

    Roadwarrior links still good

    So now I ‘m at the point that I can’t make it fail anymore after backing all my changes out <sigh>

    One thing to note in all this — none of my OpenVPN Servers do more than a depth check of 1.

  • @gribnut I just upgraded to 2.5 today and noticed right away that I couldn’t connect to OpenVPN.
    Once I set Certificate Depth to Do not check it worked again.

  • @gribnut
    thank you for your information.
    But there is still something that I can’t understand: how a length issue on the certificate subject can be fixed by just enclosing the subject in apexes?

    What I believe is that, probably, there is more than one issue here in fcgicli: an issue linked to the subject length and maybe another issue linked to «special» characters (spaces? slashes?) included in the certificate subject that is fixed by simply enclosing the subject between apexes.

  • @nycspud Do you know what error messages OpenVPN was logging while it was failing?
    I’d be curious what happens if you set Certificate Depth back to Level one, does OpenVPN start failing again or is it «magically» OK?

    As noted below, there seems to be an internal interaction were not catching that trips the Certficate checks and causes OpenVPN to fail. My experiences so far have been odd in that I’ve seen hard fails right after an upgrade but once I managed to massage the certificate depth or the ovpn_auth_verify «fix», I could no longer replicate the issue by backing out the fix.

  • @divsys Yes, setting Certificate Depth = 1 or higher causes it to fail.
    With Certificate Depth = 1 or higher
    Feb 23 07:10:48 openvpn 21518 xx.xx.xx.xx:53817 WARNING: Failed running command (—tls-verify script): external program exited with error status: 1
    Feb 23 07:10:48 openvpn 21518 xx.xx.xx.xx:53817 VERIFY SCRIPT ERROR: depth=1, C=US, ST=XX, L=XX, O=XX, emailAddress=XX@XX.XX, CN=ovpn
    Feb 23 07:10:48 openvpn 21518 xx.xx.xx.xx:53817 OpenSSL: error:1417C086:SSL routines:tls_process_client_certificate:certificate verify failed
    Feb 23 07:10:48 openvpn 21518 xx.xx.xx.xx:53817 TLS_ERROR: BIO read tls_read_plaintext error
    Feb 23 07:10:48 openvpn 21518 xx.xx.xx.xx:53817 TLS Error: TLS object -> incoming plaintext read error
    Feb 23 07:10:48 openvpn 21518 xx.xx.xx.xx:53817 TLS Error: TLS handshake failed
    Feb 23 07:10:48 openvpn 21518 xx.xx.xx.xx:53817 SIGUSR1[soft,tls-error] received, client-instance restarting

    On the client side when Certificate Depth = 1 or higher
    2021-02-23 07:11:48 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
    2021-02-23 07:11:48 TLS Error: TLS handshake failed
    2021-02-23 07:11:48 SIGUSR1[soft,tls-error] received, process restarting
    2021-02-23 07:11:48 MANAGEMENT: >STATE:1614093108,RECONNECTING,tls-error,,,,,
    2021-02-23 07:11:48 Restart pause, 5 second(s)

    I only have a self signed root CA, and no intermediate CA.

  • If it is from fcgicli, you might try the original change for #9460 (before it was fixed properly last time) by using the System Patches package and then create an entry for ce76f299853dccb036de229f08a30013593c98fd to apply the change. It will use php-cgi instead of fcgicli.

  • @fr3ddie
    I agree on skepticism that surrounding one of the key values with quotes in key/value pairs submitted to fcgicli actually fixes the problem. It’s possible that while it returns OK using workaround I listed it could cause a different behavior that may or may not work for accurately detecting cert depth. Since saving openvpn config changes overwrites ovpn_auth_verify anyway, I just went with workaround to disable cert depth check until (or if) issue is resolved with fcgicli and lengthy args to -d from bug reported in redmine.

  • @gribnut I tried your fix and it worked for me. (I’m on pfSense 2.5.0-RELEASE)
    Thank you

  • I tried the patch on pfSense 2.5.0-RELEASE also. No change. PIA VPN connection will not connect.
    Feb 24 13:45:36 openvpn 31850 Restart pause, 5 second(s)
    Feb 24 13:45:36 openvpn 31850 SIGUSR1[soft,tls-error] received, process restarting
    Feb 24 13:45:36 openvpn 31850 TCP/UDP: Closing socket
    Feb 24 13:45:36 openvpn 31850 TLS Error: TLS handshake failed
    Feb 24 13:45:36 openvpn 31850 TLS Error: TLS object -> incoming plaintext read error
    Feb 24 13:45:36 openvpn 31850 TLS_ERROR: BIO read tls_read_plaintext error
    Feb 24 13:45:36 openvpn 31850 OpenSSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
    Feb 24 13:45:36 openvpn 31850 VERIFY ERROR: depth=1, error=self signed certificate in certificate chain: C=US, ST=CA, L=LosAngeles, O=Private Internet Access, OU=Private Internet Access, CN=Private Internet Access, name=Private Internet Access, emailAddress=secure@privateinternetaccess.com, serial=11996199170155461251

    PIA suggested rolling back OpenVPN from 2.5 to 2.4.
    Any suggestions?
    Thanks.

  • @wtw said in OpenVPN 2.5.0 Certificate Verification Fails:

    I tried the patch on pfSense 2.5.0-RELEASE also. No change. PIA VPN connection will not connect.

    The problem in this thread is for OpenVPN servers on pfSense, not clients. Your problem is unlikely to be related. Start a new thread for your issue if you haven’t already.

  • As @jimp noted, the failure of cert depth check with long cert subject name is due fcgicli inability to parse long key/value strings. I have verified that replacing fcgicli with php-cgi as noted in patch for #4521 ( and #9460 ) resolves. When using php-cgi, cert depth check works as expected with my self generated cert, intermediate and root CA.

  • @gribnut said in OpenVPN 2.5.0 Certificate Verification Fails:

    As @jimp noted, the failure of cert depth check with long cert subject name is due fcgicli inability to parse long key/value strings. I have verified that replacing fcgicli with php-cgi as noted in patch for #4521 ( and #9460 ) resolves. When using php-cgi, cert depth check works as expected with my self generated cert, intermediate and root CA.

    I tried the suggestion you provded «The fifth arg ($5)» above. No change.
    I tried the patch #9460; ce76f299853dccb036de229f08a30013593c98fd as suggested. No change.
    I started a new topic: pfSense 2.5.0-RELEASE OpenVPN Cert bug
    What worked was creating a new self-signed cert using the same data. The difference in the backup XML is provided there.
    Is patch #4521 different than #9460?
    If the patch in only for an OpenVPN server, then this would be expected.

  • @jimp said in OpenVPN 2.5.0 Certificate Verification Fails:

    If it is from fcgicli, you might try the original change for #9460 (before it was fixed properly last time) by using the System Patches package and then create an entry for ce76f299853dccb036de229f08a30013593c98fd to apply the change. It will use php-cgi instead of fcgicli.

    I had the same issue immediately after upgrading from 2.4.5p1 to 2.5.0, and this fix did not work for me either. However, this was because it fixes the wrong thing.

    The commit above modifies /usr/local/sbin/ovpn_auth_verify_async, while OpenVPN actually calls /usr/local/sbin/ovpn_auth_verify. I changed this script in the same way the commit does:

    • change /usr/local/sbin/fcgicli to /usr/local/bin/php-cgi
    • remove the -d in front of the query string

    This worked; OpenVPN now again allows incoming connections.

    Here is the patch (apply with strip 0 in /usr/local/sbin) for reference:

    --- ovpn_auth_verify.orig       2021-03-07 18:20:59.312509000 +0000
    +++ ovpn_auth_verify    2021-03-07 18:21:42.060270000 +0000
    @@ -24,14 +24,14 @@
            for check_depth in $(/usr/bin/seq ${3} -1 0)
            do
                    eval serial="$tls_serial_${check_depth}"
    -               RESULT=$(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.tls-verify.php -d "servercn=$2&depth=$3&certdepth=$4&certsubject=$5&serial=$serial&config=$config")
    +               RESULT=$(/usr/local/bin/php-cgi -f /etc/inc/openvpn.tls-verify.php "servercn=$2&depth=$3&certdepth=$4&certsubject=$5&serial=$serial&config=$config")
            done
     else
            # Single quoting $password breaks getting the value from the variable.
            # Base64 and urlEncode usernames and passwords
            password=$(echo -n "${password}" | openssl enc -base64 | sed -e 's_=_%3D_g;s_+_%2B_g;s_/_%2F_g')
            username=$(echo -n "${username}" | openssl enc -base64 | sed -e 's_=_%3D_g;s_+_%2B_g;s_/_%2F_g')
    -       RESULT=$(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.auth-user.php -d "username=$username&password=$password&cn=$common_name&strictcn=$3&authcfg=$2&modeid=$4&nas_port=$5")
    +       RESULT=$(/usr/local/bin/php-cgi -f /etc/inc/openvpn.auth-user.php "username=$username&password=$password&cn=$common_name&strictcn=$3&authcfg=$2&modeid=$4&nas_port=$5")
     fi
    
     if [ "${RESULT}" = "OK" ]; then
    


    Christian

  • I can only add that I was bitten by this issue, too.
    What is interesting is that certificate verification failed for some users, but not for all.
    CA CN contains spaces and user certificates contain spaces. And yet some users can use OpenVPN and some cannot. Disabling Certificate Depth verification fixed that.
    I hope this gets classified as a bug and will be fixed in the future.

  • @shpokas
    The initial assumption of having space in the cert Subject was a red herring. Problem is actually due to length of string passed to fcgicli for key value pairs. If the cert Subject was a long value, there was a good chance the command fcgicli would fail. As noted above, it is a known issue. See #4521 for more info and patch. The patch replaces fcgicli with php-cgi in script called by OpenVPN for cert depth check. php-cgi does not have issue with the longer string argument that includes cert Subject name. You can apply the patch as a temp fix until it is applied to future version of pfsense.

  • I can confirm this.

    It is always the same thing: I googled and found do nothing
    appropriate.

    Than i dived into the things and figured out the length problem myself. Definitely, length is the problem. Reproducable on the commandline.

    When googling again with fcgicli in the search, i found this thread.

    Manually applied the patch and everthing works fine.
    👍

  • good day to all same problem i have after update pfsense to 2.5.1
    this messages i recived in server

    Jul 5 13:20:08 openvpn 90254 ip:43573 TLS Error: TLS handshake failed
    Jul 5 13:20:08 openvpn 90254 ip:43573 TLS Error: TLS object -> incoming plaintext read error
    Jul 5 13:20:08 openvpn 90254 ip:43573 TLS_ERROR: BIO read tls_read_plaintext error
    Jul 5 13:20:08 openvpn 90254 ip:43573 OpenSSL: error:1417C086:SSL routines:tls_process_client_certificate:certificate verify failed
    Jul 5 13:20:08 openvpn 90254 ip:43573 VERIFY ERROR: depth=0, error=unsupported certificate purpose: C=RO, ST=HD, L=MT, O=ITL, emailAddress=mail, CN=pfsmtsrv, OU=IT, serial=1
    Jul 5 13:19:28 openvpn 90254 Initialization Sequence Completed
    Jul 5 13:19:28 openvpn 90254 UDPv4 link remote: [AF_UNSPEC]
    Jul 5 13:19:28 openvpn 90254 UDPv4 link local (bound): [AF_INET]ip:44442
    Jul 5 13:19:28 openvpn 90254 /usr/local/sbin/ovpn-linkup ovpns4 1500 1622 ip 255.255.255.0 init
    Jul 5 13:19:28 openvpn 90254 /sbin/ifconfig ovpns4 10.1.2.1 10.1.2.2 mtu 1500 netmask 255.255.255.0 up
    Jul 5 13:19:28 openvpn 90254 TUN/TAP device /dev/tun4 opened
    Jul 5 13:19:28 openvpn 90254 TUN/TAP device ovpns4 exists previously, keep at program end
    Jul 5 13:19:28 openvpn 90254 WARNING: experimental option —capath /var/etc/openvpn/server4/ca
    Jul 5 13:19:28 openvpn 90254 Initializing OpenSSL support for engine ‘devcrypto’
    Jul 5 13:19:28 openvpn 90254 NOTE: the current —script-security setting may allow this configuration to call user-defined scripts
    Jul 5 13:19:28 openvpn 90243 library versions: OpenSSL 1.1.1k-freebsd 25 Mar 2021, LZO 2.10
    Jul 5 13:19:28 openvpn 90243 OpenVPN 2.5.1 amd64-portbld-freebsd12.2 [SSL (OpenSSL)] [LZO] [LZ4] [MH/RECVDA] [AEAD] built on Apr 5 2021
    Jul 5 13:19:28 openvpn 90243 WARNING: Compression for receiving enabled. Compression has been used in the past to break encryption. Sent packets are not compressed unless «allow-compression yes» is also set.


    This messages is in client

    Jul 5 13:24:23 openvpn 34328 UDPv4 link remote: [AF_INET]ip:44442
    Jul 5 13:24:23 openvpn 34328 UDPv4 link local (bound): [AF_INET]ip:0
    Jul 5 13:24:23 openvpn 34328 TCP/UDP: Preserving recently used remote address: [AF_INET]ip:44442
    Jul 5 13:24:23 openvpn 34328 NOTE: the current —script-security setting may allow this configuration to call user-defined scripts
    Jul 5 13:24:23 openvpn 34328 WARNING: No server certificate verification method has been enabled
    Jul 5 13:24:18 openvpn 34328 SIGUSR1[soft,ping-restart] received, process restarting
    Jul 5 13:24:18 openvpn 34328 [pfsmtsrv] Inactivity timeout (—ping-restart), restarting
    Jul 5 13:22:13 openvpn 34328 UDPv4 link remote: [AF_INET]ip:44442
    Jul 5 13:22:13 openvpn 34328 UDPv4 link local (bound): [AF_INET]ip:0
    Jul 5 13:22:13 openvpn 34328 TCP/UDP: Preserving recently used remote address: [AF_INET]89.121.228.158:44442
    Jul 5 13:22:13 openvpn 34328 WARNING: experimental option —capath /var/etc/openvpn/client2/ca
    Jul 5 13:22:13 openvpn 34328 Initializing OpenSSL support for engine ‘devcrypto’
    Jul 5 13:22:13 openvpn 34328 NOTE: the current —script-security setting may allow this configuration to call user-defined scripts
    Jul 5 13:22:13 openvpn 34328 WARNING: No server certificate verification method has been enabled.
    Jul 5 13:22:13 openvpn 34328 WARNING: using —pull/—client and —ifconfig together is probably not what you want
    Jul 5 13:22:13 openvpn 34039 library versions: OpenSSL 1.1.1k-freebsd 25 Mar 2021, LZO 2.10
    Jul 5 13:22:13 openvpn 34039 OpenVPN 2.5.1 amd64-portbld-freebsd12.2 [SSL (OpenSSL)] [LZO] [LZ4] [MH/RECVDA] [AEAD] built on Apr 5 2021
    Jul 5 13:22:13 openvpn 34039 WARNING: Compression for receiving enabled. Compression has been used in the past to break encryption. Sent packets are not compressed unless «allow-compression yes» is also set.

  • Понравилась статья? Поделить с друзьями:
  • State react как изменить
  • State of survival ошибка 42002
  • State of decay ошибка при запуске приложения 0xc0000142
  • State of decay ошибка 0xc0000906
  • State of decay yose day one edition crash dump error как исправить