transport

package
v1.7.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: GPL-3.0 Imports: 39 Imported by: 13

README

client/transport

Overview

Client-side transports and RPC wiring to communicate with Sliver servers. Builds authenticated gRPC clients, TLS dialers, and reconnect logic. Core logic addresses mTLS within the transport package.

Go Files

  • mtls.go – Configures the mutual TLS gRPC transport, including dial options and credential refresh logic.

Documentation

Index

Constants

View Source
const (

	// ClientMaxReceiveMessageSize - Max gRPC message size ~2Gb
	ClientMaxReceiveMessageSize = (2 * gb) - 1 // 2Gb - 1 byte

)

Variables

View Source
var (
	ErrMissingWireGuardConfig    = errors.New("operator config has no wg block")
	ErrIncompleteWireGuardConfig = errors.New("operator config has incomplete wg block")
)

Functions

func CloseGRPCConnection added in v1.7.4

func CloseGRPCConnection(conn *grpc.ClientConn) error

CloseGRPCConnection closes a client connection and any transport-specific resources attached to it, such as the multiplayer WireGuard tunnel.

func MTLSConnect

func MTLSConnect(config *assets.ClientConfig) (rpcpb.SliverRPCClient, *grpc.ClientConn, error)

MTLSConnect - Connect to the sliver server

func MTLSConnectWithStatus added in v1.7.6

func MTLSConnectWithStatus(config *assets.ClientConfig, statusFn ConnectStatusFn) (rpcpb.SliverRPCClient, *grpc.ClientConn, error)

MTLSConnectWithStatus connects to the sliver server and optionally reports transport phase updates, such as WireGuard setup and gRPC dialing.

func MultiplayerConnectUsesWireGuard added in v1.7.6

func MultiplayerConnectUsesWireGuard(config *assets.ClientConfig) bool

MultiplayerConnectUsesWireGuard reports whether the current mode and operator config select the WireGuard wrapper. Invalid WireGuard configs report false; the initial multiplayer dial returns the validation error.

func RootOnlyVerifyCertificate added in v1.5.0

func RootOnlyVerifyCertificate(caCertificate string, rawCerts [][]byte) error

RootOnlyVerifyCertificate - Go doesn't provide a method for only skipping hostname validation so we have to disable all of the certificate validation and re-implement everything. https://github.com/golang/go/issues/21971

func SetKeepaliveParams added in v1.7.0

func SetKeepaliveParams(p keepalive.ClientParameters)

SetKeepaliveParams configures gRPC keepalive pings for future MTLSConnect dials. Behavior is unchanged unless this is called.

func SetMultiplayerConnectMode added in v1.7.4

func SetMultiplayerConnectMode(mode MultiplayerConnectMode)

SetMultiplayerConnectMode configures future multiplayer client dials.

Types

type ConnectStatusFn added in v1.7.6

type ConnectStatusFn func(string)

ConnectStatusFn receives human-readable connection phase updates.

type MultiplayerConnectMode added in v1.7.4

type MultiplayerConnectMode int

MultiplayerConnectMode controls how the client reaches multiplayer.

const (
	// MultiplayerConnectAuto follows the explicit WireGuard opt-in recorded in
	// the operator config.
	MultiplayerConnectAuto MultiplayerConnectMode = iota
	// MultiplayerConnectEnableWG forces WireGuard for complete configs,
	// including legacy configs that predate the explicit opt-in marker.
	MultiplayerConnectEnableWG
	// MultiplayerConnectDisableWG forces direct multiplayer mTLS.
	MultiplayerConnectDisableWG

	// MultiplayerConnectDirect is retained as a source-compatible alias for
	// callers that explicitly select direct multiplayer mTLS.
	MultiplayerConnectDirect = MultiplayerConnectDisableWG
	// MultiplayerConnectRequireWG is retained for source compatibility.
	// Deprecated: use MultiplayerConnectEnableWG.
	MultiplayerConnectRequireWG = MultiplayerConnectEnableWG
)

type TokenAuth added in v1.5.0

type TokenAuth struct {
	// contains filtered or unexported fields
}

func (TokenAuth) GetRequestMetadata added in v1.5.0

func (t TokenAuth) GetRequestMetadata(ctx context.Context, in ...string) (map[string]string, error)

Return value is mapped to request headers.

func (TokenAuth) RequireTransportSecurity added in v1.5.0

func (TokenAuth) RequireTransportSecurity() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL