client: -server-cert pins the server certificate

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>
This commit is contained in:
Git Sagar 2026-10-28 15:27:36 -03:00
parent 4c2b4dcec1
commit bb92a9b954
4 changed files with 44 additions and 7 deletions

View file

@ -57,7 +57,7 @@ pkg/tap/
## CLI flags
Required: `-host`, `-user`
Optional: `-pass`, `-port` (443), `-hub` (DEFAULT), `-tap` (auto), `-mac`, `-plain-password`, `-insecure`, `-no-dhcp`, `-accept-default-gateway`, `-accept-static-routes`, `-accept-dns`, `-policy-route-table` (0=disabled), `-connmark`, `-reconnect-delay-secs` (5), `-keepalive-timeout-secs` (0=disabled)
Optional: `-pass`, `-port` (443), `-hub` (DEFAULT), `-tap` (auto), `-mac`, `-plain-password`, `-insecure`, `-server-cert` (pin a certificate file: exact match, no CA/hostname check), `-no-dhcp`, `-accept-default-gateway`, `-accept-static-routes`, `-accept-dns`, `-policy-route-table` (0=disabled), `-connmark`, `-reconnect-delay-secs` (5), `-keepalive-timeout-secs` (0=disabled)
## SoftEther protocol pitfalls