kota65535 / github-openvpn-connect-action

GitHub Action for connecting to OpenVPN server.
MIT License
85 stars 54 forks source link

Error: ***[error]VPN connection failed. #49

Closed qbaj closed 1 year ago

qbaj commented 1 year ago

Hi again,

when I use client.ovpn with inline <key> and <tls-crypt> and

config_file: .github/workflows/client.ovpn

it works.

But when I use Actions secrets with OVPN_CLIENT_KEY and OVPN_TLS_AUTH_KEY and

config_file: .github/workflows/client.ovpn client_key: ${{ secrets.OVPN_CLIENT_KEY }} tls_auth_key: ${{ secrets.OVPN_TLS_AUTH_KEY }}

it doesn't work:

running command: sudo openvpn --config .github/workflows/github.ovpn --daemon --log openvpn.log --writepid openvpn.pid

2023-09-08 18:38:32 OpenVPN 2.5.5 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 14 2022 2023-09-08 18:38:32 library versions: OpenSSL 3.0.2 15 Mar 2022, LZO 2.10 2023-09-08 18:38:32 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication 2023-09-08 18:38:32 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication 2023-09-08 18:38:32 TCP/UDP: Preserving recently used remote address: [AF_INET]xx.xx.xx.xx:xx 2023-09-08 18:38:32 Socket Buffers: R=[212992->212992] S=[212992->212992] 2023-09-08 18:38:32 UDP link local: (not bound) 2023-09-08 18:38:32 UDP link remote: [AF_INET]xx.xx.xx.xx:xx 2023-09-08 18:38:32 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay Error: ***[error]VPN connection failed.

In OVPN_CLIENT_KEY and OVPN_TLS_AUTH_KEY I added properly different versions:

\ -----BEGIN PRIVATE KEY----- xxx -----END PRIVATE KEY----- \

or

-----BEGIN PRIVATE KEY----- xxx -----END PRIVATE KEY-----

or only key without header

xxx

but nothing helped. VPN server is working, I can connect from laptop or phone.

qbaj commented 1 year ago

In OVPN_TLS_AUTH_KEY I used tls-crypt and that was a mistake. Please add https://github.com/kota65535/github-openvpn-connect-action/pull/45 and also support for tls-crypt (ver 1).