OpenVPN - Erro TLS: a negociação da chave TLS falhou em 60 segundos

1. OpenVPN - Erro TLS: a negociação da chave TLS falhou em 60 segundos

Graziele
Graziele205

(usa Outra)

Enviado em 27/09/2021 - 21:41h

Oi, gente. Eu estava tentando configurar um server openvpn, mas ao conectar pelo cliente da erro de TLS. Já abri a porta do reoteador e o firewall ta configurado. Não sei o que fiz de errado. Se alguém puder me ajudar.

ip interno: 192.168.2.239
ip externo (publico): 179.228.162.37

Config server:

port 1194
;proto tcp
proto udp

dev tap
;dev tun

ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\server.crt"
key "C:\\Program Files\\OpenVPN\\config\\server.key"
dh "C:\\Program Files\\OpenVPN\\config\\dh2048.pem"

# Generate your own with:
# openssl dhparam -out dh2048.pem 2048
dh dh2048.pem

# Configure server mode and supply a VPN subnet
server 10.8.0.0 255.255.255.0

config client:

# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client

# the firewall for the TUN/TAP interface.
dev tap
;dev tun

# Are we connecting to a TCP or
# UDP server? Use the same setting as
# on the server.
;proto tcp
proto udp

# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
remote 179.228.162.37 1194
;remote my-server-2 1194

# Choose a random host from the remote
# list for load-balancing. Otherwise
# try hosts in the order specified.
;remote-random

# Keep trying indefinitely to resolve the
# host name of the OpenVPN server. Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite

# Most clients don't need to bind to
# a specific local port number.
nobind

# Try to preserve some state across restarts.
persist-key
persist-tun

ca ca.crt
cert Graziele.crt
key Graziele.key

# EasyRSA can do this for you.
remote-cert-tls server

# If a tls-auth key is used on the server
# then every client must also have the key.
tls-auth ta.key 1

# Set log file verbosity.
verb 3






  


2. Re: OpenVPN - Erro TLS: a negociação da chave TLS falhou em 60 segundos

Carlos A. P. Cunha
Carlos_Cunha

(usa Linux Mint)

Enviado em 28/09/2021 - 11:52h

Posta o log/conteudo com o erro.


#-------------------------------------------------------------------------------------#
"Falar é fácil, me mostre o código." - Linus Torvalds
#-------------------------------------------------------------------------------------#



3. Re: OpenVPN - Erro TLS: a negociação da chave TLS falhou em 60 segundos

Perfil removido
removido

(usa Nenhuma)

Enviado em 28/09/2021 - 12:44h

Provavelmente não tem a regra de encaminhamento de porta no seu roteador.

Origem: 179.228.162.37
Destino: 192.168.2.239
Porta: 1194 (TCP/UDP)

Troubleshooting => https://openvpn.net/faq/tls-error-tls-key-negotiation-failed-to-occur-within-60-seconds-check-your-n...


4. Log

Graziele
Graziele205

(usa Outra)

Enviado em 28/09/2021 - 12:53h


Tue Sep 28 10:37:03 2021 disabling NCP mode (--ncp-disable) because not in P2MP client or server mode
Tue Sep 28 10:37:03 2021 OpenVPN 2.4.9 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Apr 16 2020
Tue Sep 28 10:37:03 2021 Windows version 6.2 (Windows 8 or greater) 64bit
Tue Sep 28 10:37:03 2021 library versions: OpenSSL 1.1.1f 31 Mar 2020, LZO 2.10
Enter Management Password:
Tue Sep 28 10:37:03 2021 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Tue Sep 28 10:37:03 2021 Need hold release from management interface, waiting...
Tue Sep 28 10:37:04 2021 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Tue Sep 28 10:37:04 2021 MANAGEMENT: CMD 'state on'
Tue Sep 28 10:37:04 2021 MANAGEMENT: CMD 'log all on'
Tue Sep 28 10:37:04 2021 MANAGEMENT: CMD 'echo all on'
Tue Sep 28 10:37:04 2021 MANAGEMENT: CMD 'bytecount 5'
Tue Sep 28 10:37:04 2021 MANAGEMENT: CMD 'hold off'
Tue Sep 28 10:37:04 2021 MANAGEMENT: CMD 'hold release'
Tue Sep 28 10:37:04 2021 MANAGEMENT: CMD 'proxy NONE '
Tue Sep 28 10:37:05 2021 interactive service msg_channel=1004
Tue Sep 28 10:37:05 2021 open_tun
Tue Sep 28 10:37:05 2021 TAP-WIN32 device [Conexão Local 2] opened: \\.\Global\{547632E9-9285-4689-80CF-F8A9F4339843}.tap
Tue Sep 28 10:37:05 2021 TAP-Windows Driver Version 9.24
Tue Sep 28 10:37:05 2021 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.8.0.2/255.255.255.0 on interface {547632E9-9285-4689-80CF-F8A9F4339843} [DHCP-serv: 10.8.0.0, lease-time: 31536000]
Tue Sep 28 10:37:05 2021 Successful ARP Flush on interface [7] {547632E9-9285-4689-80CF-F8A9F4339843}
Tue Sep 28 10:37:05 2021 MANAGEMENT: >STATE:1632836225,ASSIGN_IP,,10.8.0.2,,,,
Tue Sep 28 10:37:05 2021 TCP/UDP: Preserving recently used remote address: [AF_INET]179.228.162.37:1194
Tue Sep 28 10:37:05 2021 Socket Buffers: R=[65536->65536] S=[65536->65536]
Tue Sep 28 10:37:05 2021 UDP link local (bound): [AF_INET][undef]:1194
Tue Sep 28 10:37:05 2021 UDP link remote: [AF_INET]179.228.162.37:1194
Tue Sep 28 10:37:05 2021 MANAGEMENT: >STATE:1632836225,WAIT,,,,,,
Tue Sep 28 10:38:06 2021 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Tue Sep 28 10:38:06 2021 TLS Error: TLS handshake failed
Tue Sep 28 10:38:06 2021 SIGUSR1[soft,tls-error] received, process restarting
Tue Sep 28 10:38:06 2021 MANAGEMENT: >STATE:1632836286,RECONNECTING,tls-error,,,,,


5. Re: OpenVPN - Erro TLS: a negociação da chave TLS falhou em 60 segundos

Perfil removido
removido

(usa Nenhuma)

Enviado em 28/09/2021 - 13:01h

Esses são logs do cliente, né?!

Está dando erro no aperto de mão. Faz o seguinte... Deixe rodando um tcpdump no servidor e verifique se os pacotes estão chegando.

Ex.:
tcpdump -ni ethx udp and port 1194 



6. Re: OpenVPN - Erro TLS: a negociação da chave TLS falhou em 60 segundos

Carlos A. P. Cunha
Carlos_Cunha

(usa Linux Mint)

Enviado em 28/09/2021 - 13:47h

Parasse que não a comunicação entre as duas ponta mesmo.

No Server execute e poste a saída:

ss -nlup|grep 1194


#-------------------------------------------------------------------------------------#
"Falar é fácil, me mostre o código." - Linus Torvalds
#-------------------------------------------------------------------------------------#



7. Re: OpenVPN - Erro TLS: a negociação da chave TLS falhou em 60 segundos

Graziele
Graziele205

(usa Outra)

Enviado em 01/10/2021 - 11:47h

Fiz o que vocês falaram e realmente as portas ainda estavam fechadas.

Descobri que tem um modem no meio do caminhoa. Então, provavelmente também precisa liberar nele né?

O problema é que:
É um modem vivo com subrede 15. Meu roteador tem um endereço 15 virado pro modem, mas virado para escritório é 2. Imaginei é que podia encaminhar pra um e pro outro, mas não funcionou.

Ainda sou bem iniciante nessa área de TI. Nesses casos, quando tem um modem no meio do caminho, vocês sabem o que pode ser feito?






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts