-server-cert-sha256 <hex> replaces -server-cert <file>: the connection is
accepted only if the SHA-256 of the server's certificate (DER) matches,
colons optional, case-insensitive. No certificate or key file to handle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Accept the server only if it presents exactly the given certificate (PEM
or DER file), with no CA or hostname check, like the SoftEther client's
CheckServerCert + ServerCert. Lets a self-signed server certificate that
names no host be verified instead of turning verification off with
-insecure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tracks last server receive time (atomic) and runs a watchdog goroutine
that closes the connection if no data arrives within the timeout,
triggering reconnection. Also fixes Close() to guard Conn.Close()
inside sync.Once so concurrent/repeated calls are safe.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the server disconnects, Close() was closing both stopCh and
writeCh. The TAP→Server goroutine could race and send to the closed
writeCh, causing a panic. Fix: don't close writeCh in Close(), let
writeLoop exit via stopCh instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All writes (frames, keepalive, DHCP renewal) are queued to a buffered
channel and drained by a single writer goroutine. Eliminates mutex
contention on the data path entirely.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assemble numBlocks + frame sizes + frame data into one buffer before
writing. Reduces TLS records and syscalls from 3 per frame to 1.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WriteFrames and keepalive both write multi-part messages to the TLS
connection. Without synchronization, their writes could interleave
and corrupt the framing. Add writeMu to serialize all tunnel writes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The TAP→Server goroutine can't be interrupted (TAP fd doesn't support
deadlines). It exits on next TAP frame when WriteFrames fails on the
closed connection. Document this rather than add complexity.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- TAP→server: write buf[:n] directly instead of copy to new slice
- Keepalive: reuse fixed buffer instead of allocating every 3s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename client to "Softether Go Client"
- Fix node info int fields to use LittleEndian32 encoding matching
the C client's OutRpcNodeInfo (Admin.c:14693)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Built-in DHCP (raw Ethernet frames through tunnel), automatic reconnection,
host route management, classless static routes (option 121/249), DNS config.
Single static binary, Linux only.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>