Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not using socks5 proxy after server push reset command #662

Open
PwnTips opened this issue Jan 5, 2025 · 0 comments
Open

Not using socks5 proxy after server push reset command #662

PwnTips opened this issue Jan 5, 2025 · 0 comments
Assignees
Labels

Comments

@PwnTips
Copy link

PwnTips commented Jan 5, 2025

Describe the bug
My ISP is blocking openvpn, so I use openvpn via a socks5 proxy.
The initial connection from my client to the server always succeeds.
However, my OpenVPN server sometimes pushes the connection reset command to the client.
I found out that every connection immediately after connection reset would fail.
According to the log, when reconnecting after receiving the connection reset command, OpenVPN was not using the SOCKS proxy.
So I debugged this issue.
It seems that the following code is causing the bug.

// from socket.c:1697
static void
resolve_remote(struct link_socket *sock,
               int phase,
               const char **remote_dynamic,
               struct signal_info *sig_info)
{
    volatile int *signal_received = sig_info ? &sig_info->signal_received : NULL;
    struct gc_arena gc = gc_new();

    /* resolve remote address if undefined */
    if (!sock->info.lsa->remote_list)  // <<<<< remote_list is not null
    {
    ....
    }

    if (link_socket_actual_defined(&sock->info.lsa->actual)) {....}
    else
    {
        CLEAR(sock->info.lsa->actual);
        if (sock->info.lsa->current_remote)
        {
            set_actual_address(&sock->info.lsa->actual,
                               sock->info.lsa->current_remote); // <<<<< runs up to here, the current_remote(openvpn server) instead of the proxy server is used
        }
    }



To Reproduce

  1. connect to server via a socks proxy
  2. server push reset command to client

Expected behavior
client connect to server via socks proxy

Version information (please complete the following information):

  • OS: Windows 11 23H2
  • OpenVPN version: 2.6.12

Additional context
Add any other context about the problem here.

@flichtenheld flichtenheld self-assigned this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants