Table of Contents

Class AndroidQuicClient

Namespace
VpnHood.Net.Quic.Android
Assembly
VpnHood.Net.Quic.Android.dll

Provides the QUIC client for Android, on MsQuic (libmsquic.so) through VpnHood's own bindings rather than System.Net.Quic, whose certificate validation does not work with Android's crypto backend. Like the desktop MsQuic client, it uses TLS 1.3 and the ALPN token "h3".

public sealed class AndroidQuicClient : IQuicClient
Inheritance
AndroidQuicClient
Implements
Inherited Members

Remarks

MsQuic does the TLS handshake with its own OpenSSL and leaves the server's certificate to CertificateValidationCallback, whose answer decides. The callback gets the certificate, the chain built with the intermediates the server sent, and the errors found: a chain that does not build, or a name that does not match TargetHost. The client pins nothing itself. It applies MaxInboundBidirectionalStreams up to 65535, the most MsQuic takes.

Properties

IsSupported

Gets a value indicating whether QUIC is supported: on Android, when MsQuic's native library loads and registers.

public static bool IsSupported { get; }

Property Value

bool

Methods

ConnectAsync(QuicClientConnectOptions, CancellationToken)

Opens a QUIC connection to a server and completes its TLS handshake.

public ValueTask<IQuicConnection> ConnectAsync(QuicClientConnectOptions options, CancellationToken cancellationToken)

Parameters

options QuicClientConnectOptions

The server's endpoint, the name it is reached by and the certificate check.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask<IQuicConnection>

A task that represents the asynchronous operation. Its result is the connection; dispose it to close it.

Exceptions

NotSupportedException

The platform does not support this client's QUIC.

OperationCanceledException

cancellationToken was canceled.

IOException

The connection failed: the server could not be reached, refused it, or the certificate was rejected.

NotSupportedException

QUIC is not supported on this device (IsSupported).

OperationCanceledException

cancellationToken was canceled.

IOException

The connection failed, or the server closed it during the handshake.