Read connection state from OpenVPN's management interface #22

Closed
opened 2026-08-17 16:57:01 -04:00 by mysticalsoap · 0 comments
Owner

tunnel.py:ovpn() (roughly 421-513) is a string-match state machine over
OpenVPN's stdout: Initialization Sequence Completed, TUN/TAP device,
PUSH: Received control message, Restart pause,
SIGTERM[soft,auth-failure], Exiting due to fatal error.

Three of those print zero times under DCO, the default data path since
OpenVPN 2.6. That is the root cause of the device-detection and DNS failures.
The management interface delivers the same information as structured, versioned
events (>STATE:, >FATAL:, >PASSWORD:, >BYTECOUNT:) over a socket.

Sequencing matters -- this is the second move, not the first:

  1. Guard the QThread first, or this refactors a live wire
  2. Set the device name in the config instead of parsing it
  3. Hand DNS to OpenVPN's own --dns / resolved integration rather than porting
    the pushed-DNS scrape

Roughly half of what the log scrape does is better eliminated than migrated,
and doing so shrinks what the management client has to cover.

Scope beyond parsing: auth failures arrive as an interactive >PASSWORD: prompt
answered over the socket, which changes how credentials reach OpenVPN.

Will not fix: double-hop orchestration (tunnel.py:172-198), the
stunnel/SSH side channels (tunnel.py:531-572), or firewall/bypass logic.

`tunnel.py:ovpn()` (roughly 421-513) is a string-match state machine over OpenVPN's stdout: `Initialization Sequence Completed`, `TUN/TAP device`, `PUSH: Received control message`, `Restart pause`, `SIGTERM[soft,auth-failure]`, `Exiting due to fatal error`. Three of those print **zero** times under DCO, the default data path since OpenVPN 2.6. That is the root cause of the device-detection and DNS failures. The management interface delivers the same information as structured, versioned events (`>STATE:`, `>FATAL:`, `>PASSWORD:`, `>BYTECOUNT:`) over a socket. **Sequencing matters -- this is the second move, not the first:** 1. Guard the QThread first, or this refactors a live wire 2. Set the device name in the config instead of parsing it 3. Hand DNS to OpenVPN's own `--dns` / resolved integration rather than porting the pushed-DNS scrape Roughly half of what the log scrape does is better *eliminated* than *migrated*, and doing so shrinks what the management client has to cover. Scope beyond parsing: auth failures arrive as an interactive `>PASSWORD:` prompt answered over the socket, which changes how credentials reach OpenVPN. Will **not** fix: double-hop orchestration (`tunnel.py:172-198`), the stunnel/SSH side channels (`tunnel.py:531-572`), or firewall/bypass logic.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mysticalsoap/aqomui#22
No description provided.