Documentation
¶
Index ¶
- Constants
- Variables
- type AuthChallengeError
- type AuthFailedAdvance
- type AuthFailedTemporaryError
- type AuthFailedTerminalError
- type AuthRetryMode
- type AuthTokenAuthenticationFailedError
- type CRV1Challenge
- type Challenge
- type ChallengeKind
- type ChallengeResponse
- type Client
- func (c *Client) CancelChallenge(challengeID string) error
- func (c *Client) ChallengeUpdated() <-chan struct{}
- func (c *Client) Close() error
- func (c *Client) CompleteChallenge(challengeID string, response ChallengeResponse) error
- func (c *Client) CompressionPushRejection() string
- func (c *Client) DroppedIncomingDataPackets() uint64
- func (c *Client) PendingChallenge() *Challenge
- func (c *Client) PullFilterRejection() string
- func (c *Client) ReadDataPacket(ctx context.Context) ([]byte, error)
- func (c *Client) ReadDataPacketBuffer(ctx context.Context) (*buf.Buffer, error)
- func (c *Client) ReadDataPackets(ctx context.Context) ([]*buf.Buffer, error)
- func (c *Client) Ready() bool
- func (c *Client) RestartSession()
- func (c *Client) Start() error
- func (c *Client) TunnelConfiguration() TunnelConfiguration
- func (c *Client) WriteDataPacket(packet []byte) error
- func (c *Client) WriteDataPacketBuffers(packetBuffers []*buf.Buffer) error
- func (c *Client) WriteDataPackets(packets [][]byte) error
- type ClientAuthenticationOptions
- type ClientDataChannelOptions
- type ClientOptions
- type ClientPullOptions
- type ClientTLSOptions
- type ClientTimingOptions
- type ClientTransportOptions
- type ClientTunnelOptions
- type Material
- type PullFilter
- type Remote
- type RouteMissError
- type Server
- func (s *Server) Close() error
- func (s *Server) DroppedIncomingDataPackets() uint64
- func (s *Server) ReadDataPacket(ctx context.Context) (ServerDataPacket, error)
- func (s *Server) ReadDataPacketBuffer(ctx context.Context) (ServerDataBuffer, error)
- func (s *Server) ReadDataPackets(ctx context.Context) ([]ServerDataBuffer, error)
- func (s *Server) Start() error
- func (s *Server) WriteDataPacket(peerAddress string, packet []byte) error
- func (s *Server) WriteDataPacketBuffersByDestination(packetBuffers []*buf.Buffer) ([]*RouteMissError, error)
- func (s *Server) WriteDataPacketByDestination(packet []byte) error
- func (s *Server) WriteDataPackets(peerAddress string, packets [][]byte) error
- func (s *Server) WriteDataPacketsByDestination(packets [][]byte) ([]*RouteMissError, error)
- type ServerAuthenticationOptions
- type ServerDataBuffer
- type ServerDataChannelOptions
- type ServerDataPacket
- type ServerOptions
- type ServerPushOptions
- type ServerResourceOptions
- type ServerTLSOptions
- type ServerTimingOptions
- type ServerTransportOptions
- type ServerTunnelOptions
- type TunnelConfiguration
- type TunnelConfigurationEvent
- type TunnelConfigurationEventReason
- type TunnelDNSServer
- type TunnelRoute
- type UserPassAuthenticator
Constants ¶
View Source
const ( MSSFixModeMTU = "mtu" MSSFixModeFixed = "fixed" )
View Source
const ( ModeTLS = "tls" ModeStaticKey = "static_key" )
Variables ¶
View Source
var ( ErrMissingServer = E.New("missing openvpn server") ErrMissingListenAddress = E.New("missing openvpn listen address") ErrUnsupportedProtocol = E.New("unsupported openvpn protocol") ErrUnsupportedMode = E.New("unsupported openvpn mode") ErrHandshakeTimeout = E.New("control handshake timeout") ErrNoPushReply = E.New("server did not reply to push requests") ErrDataChannelNotReady = E.New("data channel is not ready") ErrClientClosed = E.New("client is closed") ErrServerClosed = E.New("server is closed") ErrPeerNotFound = E.New("peer not found") ErrMissingStaticKey = E.New("missing openvpn static key") ErrCompressionNotSupported = E.New("unsupported compression option") ErrOptionNotSupported = E.New("option is not supported yet") ErrAuthenticationFailed = E.New("authentication failed") ErrServerRestart = E.New("server requested restart") ErrServerHalt = E.New("server halted session") ErrServerExit = E.New("server exited") ErrPeerExit = E.New("peer exited") ErrPeerRestart = E.New("peer started a new hard-reset session") ErrPeerCertificateVerification = E.New("peer certificate verification failed") ErrPeerCertificateRevoked = E.New("peer certificate is revoked") ErrPeerCertificateExtUsage = E.New("peer certificate is missing required extended key usage") ErrPeerCertificateKeyUsage = E.New("peer certificate is missing required key usage") ErrPeerCertificateNSCertType = E.New("peer certificate fails ns-cert-type check") ErrPeerCertificateName = E.New("peer certificate fails verify-x509-name check") ErrPeerCertificatePurpose = E.New("unsuitable certificate purpose") ErrCRLSignatureInvalid = E.New("CRL signature not issued by a trusted CA") ErrCRLExpired = E.New("CRL is outside its validity window") ErrCRLIssuerKeyUsage = E.New("CRL issuer certificate is not allowed to sign CRLs") ErrPullFilterRejected = E.New("pushed option rejected by pull-filter") ErrCompressionPushRejected = E.New("pushed compression rejected") ErrCipherNegotiationFailed = E.New("cipher negotiation failed with peer") ErrRenegotiationRequired = E.New("data channel reached renegotiation threshold") ErrIPPoolExhausted = E.New("server ifconfig pool is exhausted") ErrRouteNotFound = E.New("route not found") ErrInvalidIPPacket = E.New("invalid ip packet") ErrPingRestartTimeout = E.New("ping-restart timeout") ErrPingExitTimeout = E.New("ping-exit timeout") ErrNoPendingChallenge = E.New("no pending openvpn challenge") ErrChallengeNotAnswerable = E.New("challenge does not accept a response") ErrChallengeCanceled = E.New("authentication challenge canceled") ErrAuthPendingTimeout = E.New("pending authentication timed out") ErrInactiveTimeout = E.New("inactive timeout") ErrSessionTimeout = E.New("session timeout") ErrRemoteAddressExhausted = E.New("remote address list exhausted") ErrServerResourceLimit = E.New("server resource limit reached") ErrFatalDecryption = E.New("fatal decryption error") )
View Source
var ErrAllowCompressionConflict = E.New("allow-compression no conflicts with statically enabled compression")
Upstream options_postprocess_mutate (options.c) flags --allow-compression no with non-stub compression.
View Source
var ErrInvalidAllowCompression = E.New("invalid allow-compression value")
Upstream options_postprocess_mutate (options.c) rejects bad --allow-compression tokens.
View Source
var ErrMaterialSourceConflict = E.New("material path and content are both set")
View Source
var ErrMissingCAOrPeerFingerprint = E.New("tls mode: either certificate-authority or peer-fingerprint must be configured")
Upstream options_postprocess_filechecks (options.c) rejects TLS without CA material or peer fingerprints.
Functions ¶
This section is empty.
Types ¶
type AuthChallengeError ¶
type AuthChallengeError struct {
Challenge CRV1Challenge
}
func (*AuthChallengeError) Error ¶
func (authError *AuthChallengeError) Error() string
func (*AuthChallengeError) Unwrap ¶
func (authError *AuthChallengeError) Unwrap() error
type AuthFailedAdvance ¶
type AuthFailedAdvance int
const ( AuthFailedAdvanceNextAddress AuthFailedAdvance = iota AuthFailedAdvanceNextRemote AuthFailedAdvanceStay )
type AuthFailedTemporaryError ¶
type AuthFailedTemporaryError struct {
BackoffSeconds uint32
Advance AuthFailedAdvance
Reason string
}
func (*AuthFailedTemporaryError) Error ¶
func (temporaryError *AuthFailedTemporaryError) Error() string
func (*AuthFailedTemporaryError) Unwrap ¶
func (temporaryError *AuthFailedTemporaryError) Unwrap() error
type AuthFailedTerminalError ¶
type AuthFailedTerminalError struct {
Reason string
}
func (*AuthFailedTerminalError) Error ¶
func (terminalError *AuthFailedTerminalError) Error() string
func (*AuthFailedTerminalError) Terminal ¶
func (terminalError *AuthFailedTerminalError) Terminal() bool
func (*AuthFailedTerminalError) Unwrap ¶
func (terminalError *AuthFailedTerminalError) Unwrap() error
type AuthRetryMode ¶
type AuthRetryMode string
const ( AuthRetryModeNone AuthRetryMode = "none" AuthRetryModeNoInteract AuthRetryMode = "nointeract" AuthRetryModeInteract AuthRetryMode = "interact" )
type AuthTokenAuthenticationFailedError ¶
type AuthTokenAuthenticationFailedError struct {
Reason string
}
func (*AuthTokenAuthenticationFailedError) Error ¶
func (tokenError *AuthTokenAuthenticationFailedError) Error() string
func (*AuthTokenAuthenticationFailedError) Unwrap ¶
func (tokenError *AuthTokenAuthenticationFailedError) Unwrap() error
type CRV1Challenge ¶
type ChallengeKind ¶
type ChallengeKind string
const ( ChallengeCredentials ChallengeKind = "credentials" ChallengeSecret ChallengeKind = "secret" ChallengeMessage ChallengeKind = "message" ChallengeOpenURL ChallengeKind = "open-url" )
type ChallengeResponse ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ClientOptions) (*Client, error)
func (*Client) CancelChallenge ¶
func (*Client) ChallengeUpdated ¶
func (c *Client) ChallengeUpdated() <-chan struct{}
func (*Client) CompleteChallenge ¶
func (c *Client) CompleteChallenge(challengeID string, response ChallengeResponse) error
func (*Client) CompressionPushRejection ¶
func (*Client) DroppedIncomingDataPackets ¶
func (*Client) PendingChallenge ¶
func (*Client) PullFilterRejection ¶
func (*Client) ReadDataPacket ¶
func (*Client) ReadDataPacketBuffer ¶
func (*Client) ReadDataPackets ¶
func (*Client) RestartSession ¶
func (c *Client) RestartSession()
func (*Client) TunnelConfiguration ¶
func (c *Client) TunnelConfiguration() TunnelConfiguration
func (*Client) WriteDataPacket ¶
func (*Client) WriteDataPacketBuffers ¶
func (*Client) WriteDataPackets ¶
type ClientDataChannelOptions ¶
type ClientDataChannelOptions struct {
MTU uint32
MSSFix uint32
MSSFixDisabled bool
MSSFixMode string
Fragment uint32
Cipher string
Ciphers []string
FallbackCipher string
Auth string
Compression string
CompressionLZO string
AllowCompression string
ReplayWindow uint32
ReplayWindowTime time.Duration
PacketHeadroom int
}
type ClientOptions ¶
type ClientOptions struct {
Context context.Context
Mode string
Transport ClientTransportOptions
DataChannel ClientDataChannelOptions
TLS ClientTLSOptions
Authentication ClientAuthenticationOptions
Pull ClientPullOptions
Tunnel ClientTunnelOptions
Timing ClientTimingOptions
StaticKey Material
KeyDirection int
OnTunnelConfiguration func(event TunnelConfigurationEvent) error
Logger logger.ContextLogger
}
type ClientPullOptions ¶
type ClientPullOptions struct {
Enabled bool
Filters []PullFilter
RouteNoPull bool
}
type ClientTLSOptions ¶
type ClientTLSOptions struct {
CertificateAuthority Material
Certificate Material
Key Material
Auth Material
Crypt Material
CryptV2 Material
VerifyX509Name string
VerifyX509Type string
PeerFingerprint []string
CRLVerify string
RemoteCertificateKU []string
RemoteCertificateEKU string
RemoteCertificateTLS string
NSCertificateType string
VersionMin string
VersionMax string
CertificateProfile string
Cipher string
Groups string
}
type ClientTimingOptions ¶
type ClientTransportOptions ¶
type ClientTransportOptions struct {
Remotes []Remote
RemoteRandom bool
DialContext func(ctx context.Context, network string, address string) (net.Conn, error)
DialContextWithAddressIndex func(ctx context.Context, network string, address string, addressIndex int) (net.Conn, error)
Protocol string
ExplicitExitNotify uint32
}
type ClientTunnelOptions ¶
type ClientTunnelOptions struct {
DevType string
Topology string
RedirectGateway bool
RedirectGatewayFlags []string
RedirectPrivate bool
RouteMetric int
BlockIPv6 bool
BlockOutsideDNS bool
RouteGateway netip.Addr
Routes []TunnelRoute
DHCPOptions []string
LocalAddress []netip.Prefix
VPNGateway netip.Addr
VPNGatewayIPv6 netip.Addr
}
type PullFilter ¶
type RouteMissError ¶
func (*RouteMissError) Error ¶
func (e *RouteMissError) Error() string
func (*RouteMissError) Unwrap ¶
func (e *RouteMissError) Unwrap() error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(options ServerOptions) (*Server, error)
func (*Server) DroppedIncomingDataPackets ¶
func (*Server) ReadDataPacket ¶
func (s *Server) ReadDataPacket(ctx context.Context) (ServerDataPacket, error)
func (*Server) ReadDataPacketBuffer ¶
func (s *Server) ReadDataPacketBuffer(ctx context.Context) (ServerDataBuffer, error)
func (*Server) ReadDataPackets ¶
func (s *Server) ReadDataPackets(ctx context.Context) ([]ServerDataBuffer, error)
func (*Server) WriteDataPacket ¶
func (*Server) WriteDataPacketBuffersByDestination ¶
func (s *Server) WriteDataPacketBuffersByDestination(packetBuffers []*buf.Buffer) ([]*RouteMissError, error)
func (*Server) WriteDataPacketByDestination ¶
func (*Server) WriteDataPackets ¶
func (*Server) WriteDataPacketsByDestination ¶
func (s *Server) WriteDataPacketsByDestination(packets [][]byte) ([]*RouteMissError, error)
type ServerAuthenticationOptions ¶
type ServerAuthenticationOptions struct {
Authenticator UserPassAuthenticator
DuplicateCN bool
}
type ServerDataBuffer ¶
type ServerDataPacket ¶
type ServerOptions ¶
type ServerOptions struct {
Context context.Context
Mode string
Transport ServerTransportOptions
Resources ServerResourceOptions
DataChannel ServerDataChannelOptions
TLS ServerTLSOptions
Authentication ServerAuthenticationOptions
Timing ServerTimingOptions
Tunnel ServerTunnelOptions
Push ServerPushOptions
StaticKey Material
KeyDirection int
Logger logger.ContextLogger
}
type ServerPushOptions ¶
type ServerPushOptions struct {
Routes []netip.Prefix
DNS []netip.Addr
DNSServers []TunnelDNSServer
SearchDomains []string
DHCPOptions []string
BlockOutsideDNS bool
PingInterval time.Duration
PingIntervalEnabled bool
PingRestart time.Duration
PingRestartEnabled bool
RedirectGateway bool
RedirectGatewayFlags []string
}
type ServerResourceOptions ¶
type ServerTLSOptions ¶
type ServerTLSOptions struct {
CertificateAuthority Material
Certificate Material
Key Material
Auth Material
Crypt Material
CryptV2 Material
CryptV2ForceCookie bool
VerifyClientCertificate string
VerifyX509Name string
VerifyX509Type string
PeerFingerprint []string
CRLVerify string
RemoteCertificateKU []string
RemoteCertificateEKU string
RemoteCertificateTLS string
NSCertificateType string
VersionMin string
VersionMax string
CertificateProfile string
Cipher string
Groups string
}
type ServerTimingOptions ¶
type ServerTransportOptions ¶
type ServerTunnelOptions ¶
type TunnelConfiguration ¶
type TunnelConfiguration struct {
DevType string
Topology string
TunMTU uint32
LocalIPv4 []netip.Prefix
LocalIPv6 []netip.Prefix
VPNGateway netip.Addr
VPNGatewayIPv6 netip.Addr
IPv4Routes []TunnelRoute
IPv6Routes []TunnelRoute
ExcludedIPv4Routes []TunnelRoute
ExcludedIPv6Routes []TunnelRoute
DNS []netip.Addr
DNSServers []TunnelDNSServer
DHCPOptions []string
SearchDomains []string
DNSRoutes []string
BlockIPv6 bool
BlockOutsideDNS bool
RedirectGateway bool
RedirectGatewayFlags []string
RedirectPrivate bool
RouteMetric int
RouteGateway netip.Addr
PingInterval time.Duration
PingRestart time.Duration
AuthToken string
AuthTokenUser string
ExplicitExitNotify uint32
PeerID *uint32
SelectedCipher string
SelectedAuth string
ProtocolFlags []string
KeyDerivation string
InactiveTimeout time.Duration
InactiveMinimumBytes uint64
SessionTimeout time.Duration
PingExit time.Duration
PingTimerRemote bool
}
type TunnelConfigurationEvent ¶
type TunnelConfigurationEvent struct {
Reason TunnelConfigurationEventReason
Configuration TunnelConfiguration
}
type TunnelConfigurationEventReason ¶
type TunnelConfigurationEventReason string
const ( TunnelConfigurationEventInitial TunnelConfigurationEventReason = "initial" TunnelConfigurationEventPushUpdate TunnelConfigurationEventReason = "push_update" TunnelConfigurationEventRenegotiation TunnelConfigurationEventReason = "renegotiation" )
type TunnelDNSServer ¶
Source Files
¶
- allow_compression.go
- auth.go
- certificate_purpose.go
- certificate_subject.go
- challenge.go
- cipher_negotiation.go
- client.go
- client_control.go
- client_data.go
- client_keepalive.go
- client_restart.go
- client_session_static.go
- client_session_tls.go
- client_supervisor.go
- client_timing.go
- client_tunnel.go
- compression_options.go
- control_channel.go
- control_directives.go
- control_stream.go
- control_wrap.go
- data_channel_compression.go
- data_channel_fragmentation.go
- data_channel_framing.go
- data_codec.go
- data_codec_aead.go
- data_codec_cbc.go
- data_codec_static.go
- data_codec_stream.go
- data_queue.go
- errors.go
- ip_pool.go
- keepalive.go
- key_method.go
- lzo_compress.go
- mss_budget.go
- mss_clamp.go
- options.go
- options_validation.go
- peer_certificate_verifier.go
- peer_data.go
- peer_route_registry.go
- peer_session.go
- pull_options.go
- push_options.go
- renegotiation.go
- replay_window.go
- route_options.go
- server.go
- server_data.go
- server_identity.go
- server_listener.go
- server_negotiation.go
- server_ping.go
- server_renegotiation.go
- server_resource_policy.go
- server_session.go
- server_static.go
- server_tls.go
- server_tunnel.go
- session_id_hmac.go
- tls_config.go
- tunnel_options.go
- udp_peer_conn.go
- udp_predecrypt.go
Click to show internal directories.
Click to hide internal directories.