Commit Graph

3 Commits

Author SHA1 Message Date
Wolfgang Bumiller
941f0305a2 cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-04 11:54:36 +01:00
Fabian Grünbichler
838b8aafca add fingerprint validation
in case we have no explicit fingerprint, we use openssl's regular "PEER"
verification. if we have a fingerprint, we ignore openssl verification
results altogether and just verify the fingerprint of the presented leaf
certificate, skipping the rest of the certificate chain (depth != 0).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-02-04 09:15:40 +01:00
Fabian Grünbichler
c18e63b96f add tunnel implementation
the websocket tunnel helper accepts control commands (encoded as
single-line JSON) on stdin, and prints responses on stdout.

the following commands are available:
- "connect" a 'control' tunnel via a websocket
- "forward" a local unix socket to a remote socket via a websocket
-- if requested, this will ask for a ticket via the control tunnel after
accepting a new connection on the unix socket
- "close" the control tunnel and any forwarded socket

any other json input (without the 'control' flag set) is forwarded as-is
to the remote end of the control tunnel.

internally, the tunnel helper will spawn tokio tasks for
- handling the control tunnel connection (new commands are passed in via
an mpsc channel together with a oneshot channel for the response)
- handling accepting new connections on each forwarded unix socket
- handling forwarding data over accepted forwarded connections

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-02-04 09:15:40 +01:00