Skip to main content
Version: 0.8.0
Docs.rs: ironrdp-connector

Overview

The ironrdp-connector crate provides abstract state machines for establishing RDP connections. It handles the complex multi-phase connection sequence:
  1. X.224 negotiation
  2. MCS connection
  3. Security exchange (CredSSP/NLA or legacy TLS)
  4. Capability negotiation
  5. Channel join
  6. Connection finalization
The connector is transport-agnostic - it produces PDUs to send and consumes PDUs received, but does not perform I/O.

Core Types

Config

Configuration for the RDP connection. See ironrdp_pdu::rdp::capability_sets and ironrdp_pdu::gcc for related types.

Credentials

DesktopSize

BitmapConfig

State Machine Traits

Sequence

Base trait for all connection state machines. Methods:
fn(&self) -> Option<&dyn PduHint>
Returns a hint for detecting the next PDU boundary (for framing)
fn(&self) -> &dyn State
Returns the current state (for introspection/logging)
fn(&mut self, input: &[u8], output: &mut WriteBuf) -> ConnectorResult<Written>
Process input PDU and generate output PDU(s)
fn(&mut self, output: &mut WriteBuf) -> ConnectorResult<Written>
Generate output PDU(s) without processing input (for initial requests)

State

Represents the current state of a sequence.

Written

Return value from step() indicating how many bytes were written.

Connection Sequences

ClientConnector

Example:

ChannelConnectionSequence

Handles joining static virtual channels after the main connection.

LicenseExchangeSequence

Handles RDP licensing exchange.

ConnectionFinalizationSequence

Finalizes the connection after capability exchange.

CredSSP Support

This crate re-exports the sspi crate for CredSSP/NLA:
CredSSP provides network-level authentication before the full RDP connection.

Error Handling

NegotiationFailure

Example errors:
  • “server requires Enhanced RDP Security with CredSSP”
  • “server only supports Standard RDP Security”
  • “server lacks valid authentication certificate”

Utilities

encode_x224_packet

Helper to wrap a PDU in X.224 framing.

encode_send_data_request

Encode an MCS Send Data Request PDU.

Features

feature
Enable arbitrary::Arbitrary derives for fuzzing
feature
Enable QOI image codec (passed through to ironrdp-pdu)
feature
Enable QOI + Zstd compressed images

Usage Notes

Transport Agnostic:
The connector does NOT perform network I/O. You provide input bytes from the network and send output bytes to the network. This design allows:
  • Synchronous or asynchronous I/O
  • TCP, TLS, or any custom transport
  • Easy testing and fuzzing
State Introspection:
Use state().name() for logging:
Use state_is::<T>() or state_downcast::<T>() to check specific states.
Security Recommendations:
Set enable_tls = false to enforce NLA (CredSSP). Legacy TLS security (without NLA) has a large attack surface and should be avoided.
See the Config::enable_tls documentation for security considerations.

See Also