mysteriumnetwork / go-openvpn

GNU Affero General Public License v3.0
119 stars 33 forks source link

true Name:CONNECTION_TIMEOUT Info: #56

Open aadog opened 4 years ago

aadog commented 4 years ago

Library check >> OpenVPN core 3.git:master win x86_64 64-bit built on Nov 29 2018 15:40:15 Library check >> Copyright (C) 2012-2017 OpenVPN Inc. All rights reserved. Openvpn log >> Frame=512/2048/512 mssfix-ctrl=1250 Openvpn log >> Openvpn log >> UNUSED OPTIONS Openvpn log >> 2 [explicit-exit-notify] Openvpn log >> 5 [resolv-retry] [infinite] Openvpn log >> 6 [nobind] Openvpn log >> 7 [persist-key] Openvpn log >> 8 [persist-tun] Openvpn log >> 10 [verify-x509-name] [server_gZXUkvY4J2z82D0v] [name] Openvpn log >> 12 [auth-nocache] Openvpn log >> 14 [tls-client] Openvpn log >> 16 [tls-cipher] [TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256] Openvpn log >> 17 [block-outside-dns] Openvpn log >> 18 [verb] [3] Openvpn log >> Openvpn event >> {Fatal:false Error:false Name:RESOLVE Info:} Openvpn log >> Contacting 47.240.247.45:1194 via UDP Openvpn log >> Openvpn event >> {Fatal:false Error:false Name:WAIT Info:} Openvpn log >> Connecting to [47.240.247.45]:1194 (47.240.247.45) via UDPv4 Openvpn log >> Openvpn event >> {Fatal:false Error:false Name:CONNECTING Info:} Openvpn log >> Tunnel Options:V4,dev-type tun,link-mtu 1521,tun-mtu 1500,proto UDPv4,cipher AES-128-GCM,auth SHA256,keysize 128,key-method 2,tls-client Openvpn log >> Openvpn log >> Creds: UsernameEmpty/PasswordEmpty Openvpn log >> Openvpn log >> Peer Info: Openvpn log >> IV_GUI_VER=cli 1.0 Openvpn log >> IV_VER=3.git:master Openvpn log >> IV_PLAT=win Openvpn log >> IV_NCP=2 Openvpn log >> IV_TCPNL=1 Openvpn log >> IV_PROTO=2 Openvpn log >> IV_AUTO_SESS=1 Openvpn log >> Openvpn log >> Openvpn log >> VERIFY OK : depth=1 Openvpn log >> cert. version : 3 Openvpn log >> serial number : F5:67:14:60:67:0F:AB:34 Openvpn log >> issuer name : CN=cn_dXHy9F5iJ3o9g1yX Openvpn log >> subject name : CN=cn_dXHy9F5iJ3o9g1yX Openvpn log >> issued on : 2020-04-23 14:46:47 Openvpn log >> expires on : 2030-04-21 14:46:47 Openvpn log >> signed using : ECDSA with SHA256 Openvpn log >> EC key size : 256 bits Openvpn log >> basic constraints : CA=true Openvpn log >> key usage : Key Cert Sign, CRL Sign Openvpn log >> Openvpn log >> Openvpn log >> VERIFY OK : depth=0 Openvpn log >> cert. version : 3 Openvpn log >> serial number : F9:77:F2:BF:12:9D:46:FA:BA:B0:2E:94:9B:12:65:87 Openvpn log >> issuer name : CN=cn_dXHy9F5iJ3o9g1yX Openvpn log >> subject name : CN=server_gZXUkvY4J2z82D0v Openvpn log >> issued on : 2020-04-23 14:46:47 Openvpn log >> expires on : 2023-04-08 14:46:47 Openvpn log >> signed using : ECDSA with SHA256 Openvpn log >> EC key size : 256 bits Openvpn log >> basic constraints : CA=false Openvpn log >> subject alt name : server_gZXUkvY4J2z82D0v Openvpn log >> key usage : Digital Signature, Key Encipherment Openvpn log >> ext key usage : TLS Web Server Authentication Openvpn log >> Openvpn log >> Openvpn stats >> {BytesIn:1525 BytesOut:582} Openvpn stats >> {BytesIn:1525 BytesOut:786} Openvpn stats >> {BytesIn:1525 BytesOut:990} Openvpn stats >> {BytesIn:1525 BytesOut:1194} Openvpn stats >> {BytesIn:1525 BytesOut:1398} Openvpn stats >> {BytesIn:1525 BytesOut:1602} Openvpn stats >> {BytesIn:1525 BytesOut:1806} Openvpn stats >> {BytesIn:1525 BytesOut:2010} Openvpn stats >> {BytesIn:1525 BytesOut:2214} Openvpn stats >> {BytesIn:1525 BytesOut:2418} Openvpn event >> {Fatal:true Error:true Name:CONNECTION_TIMEOUT Info:} Openvpn event >> {Fatal:false Error:false Name:DISCONNECTED Info:} Openvpn log >> Openvpn3 session ended Graceful exit

配置.txt

zolia commented 4 years ago

It is hard to say what is the problem without seeing server side logs.

peeweep commented 3 years ago
Openvpn log >> Creds: UsernameEmpty/PasswordEmpty

I get the same problem. My authentication method is to use the account password, which is configured in the ovpn file

example.ovpn

auth-user-pass pass.txt

pass.txt

your_username
your_passwd

Just hardcode the username and password in openvpn3/credentials.go like this is work fine.

diff --git a/openvpn3/credentials.go b/openvpn3/credentials.go
index d09fdf6..2c70377 100644
--- a/openvpn3/credentials.go
+++ b/openvpn3/credentials.go
@@ -29,8 +29,10 @@ type UserCredentials struct {
 }

 func (credentials *UserCredentials) toPtr() (cCredentials C.user_credentials, unregister func()) {
-       cUsername := newCharPointer(credentials.Username)
-       cPassword := newCharPointer(credentials.Password)
+       //cUsername := newCharPointer(credentials.Username)
+       //cPassword := newCharPointer(credentials.Password)
+       cUsername := newCharPointer("your_username")
+       cPassword := newCharPointer("your_passwd")

        cCredentials = C.user_credentials{
                username: cUsername.Ptr,
nikohpng commented 1 year ago

I have same issue. have someone solve it?

nikohpng commented 1 year ago

@peeweep hello, do you solve it ?

peeweep commented 1 year ago

@nikohpng Yes, like my comment above.

nikohpng commented 1 year ago

can you give me a example vpn conf? My question is very strange.