Skip to main content
FreeRDP supports the full spectrum of RDP security mechanisms defined in MS-RDPBCGR and related specifications — from the legacy RDP Security Layer through TLS transport encryption and Network Level Authentication (NLA) with NTLM or Kerberos.

Security Mode Overview

Security negotiation is performed by nego.c. The client advertises its supported protocols and the server selects one. FreeRDP defaults to preferring NLA.

Transport Security: TLS

Once the protocol negotiation selects TLS or NLA, transport.c upgrades the raw TCP socket to a TLS channel. FreeRDP supports three TLS backends selected at build time: TLS protocol version and cipher suite negotiation follow the backend’s defaults, with FreeRDP enforcing a minimum of TLS 1.0 (TLS 1.2+ strongly recommended).

Authentication: NLA / CredSSP

NLA (Network Level Authentication) wraps a CredSSP exchange inside the TLS channel. CredSSP carries SPNEGO tokens that negotiate either NTLM or Kerberos.

NTLM

FreeRDP’s NTLM implementation lives in WinPR (libwinpr/sspi/NTLM/). It is always available without additional dependencies.

Kerberos

Kerberos support requires an MIT Kerberos or Heimdal installation at build time: At runtime, the Kerberos subsystem is selected via the standard GSSAPI interface. On domain-joined Linux hosts, Kerberos tickets obtained via kinit are used automatically.

NLA API


Authentication Callbacks

Credentials are supplied to FreeRDP through callbacks set on the freerdp instance. The preferred callback is AuthenticateEx, which also receives the reason for the prompt:
All three string arguments are pre-allocated on input and must be freed before assigning new values. Return TRUE with empty strings to continue without credentials; return FALSE to abort the connection.

Smartcard / PKCS#11 Logon

FreeRDP supports smartcard-based NLA authentication. When smartcard logon is in use:
  1. freerdp_settings_set_bool(settings, FreeRDP_SmartcardLogon, TRUE) is set.
  2. The ChooseSmartcard callback on the freerdp instance is called when multiple smartcard certificates are detected:
  1. For PKCS#11 token access, the PKCS#11 module path is set via FreeRDP_Pkcs11Module.
  2. The AUTH_SMARTCARD_PIN reason in AuthenticateEx is used to prompt for the card PIN.
The smartcard virtual channel (channels/smartcard/) handles runtime smartcard operations during the active session separately from NLA logon.

Certificate Verification

FreeRDP provides two certificate verification callback mechanisms on the freerdp instance. VerifyX509Certificate is the recommended modern approach (full PEM chain):

VERIFY_CERT_FLAG_* Constants

Defined in include/freerdp/freerdp.h:

Certificate Persistence

FreeRDP ships a certificate store (include/freerdp/crypto/certificate_store.h) that saves accepted certificate fingerprints on disk (typically ~/.config/freerdp/known_hosts2). When a certificate is encountered:
  • Not foundVerifyCertificateEx / VerifyX509Certificate is called.
  • Found, matches → connection proceeds silently.
  • Found, changedVerifyChangedCertificateEx is called (flags include VERIFY_CERT_FLAG_CHANGED).
You can bypass certificate verification entirely for testing with:
FreeRDP_IgnoreCertificate = TRUE disables all certificate checks and must never be used in production. It is equivalent to --no-verify and exposes connections to man-in-the-middle attacks.

AAD / Azure Virtual Desktop

FreeRDP 3.x adds OAuth2 / Azure Active Directory token support for Azure Virtual Desktop (AVD) connections via the GetAccessToken callback:
Since version 3.16.0 a common access token provider can also be registered at the context level:

Security Checklist

NLA authenticates the server before any session data is exchanged, preventing credential exposure to a rogue server. Set FreeRDP_NlaSecurity = TRUE and FreeRDP_RdpSecurity = FALSE.
Always implement VerifyX509Certificate or VerifyCertificateEx. At minimum, reject connections with VERIFY_CERT_FLAG_MISMATCH set. Consider pinning the expected fingerprint in FreeRDP_CertificateAcceptedFingerprints.
Set credentials in AuthenticateEx on demand rather than baking them into settings at startup. This reduces the window during which a password is resident in memory.
FreeRDP inherits the TLS implementation from its backend. Ensure OpenSSL / MbedTLS is current to benefit from security patches.