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 thefreerdp instance. The preferred callback is AuthenticateEx, which also receives the reason for the prompt:
Smartcard / PKCS#11 Logon
FreeRDP supports smartcard-based NLA authentication. When smartcard logon is in use:freerdp_settings_set_bool(settings, FreeRDP_SmartcardLogon, TRUE)is set.- The
ChooseSmartcardcallback on thefreerdpinstance is called when multiple smartcard certificates are detected:
- For PKCS#11 token access, the PKCS#11 module path is set via
FreeRDP_Pkcs11Module. - The
AUTH_SMARTCARD_PINreason inAuthenticateExis used to prompt for the card PIN.
channels/smartcard/) handles runtime smartcard operations during the active session separately from NLA logon.
Certificate Verification
FreeRDP provides two certificate verification callback mechanisms on thefreerdp 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 found →
VerifyCertificateEx/VerifyX509Certificateis called. - Found, matches → connection proceeds silently.
- Found, changed →
VerifyChangedCertificateExis called (flags includeVERIFY_CERT_FLAG_CHANGED).
AAD / Azure Virtual Desktop
FreeRDP 3.x adds OAuth2 / Azure Active Directory token support for Azure Virtual Desktop (AVD) connections via theGetAccessToken callback:
Security Checklist
Always use NLA in production
Always use NLA in production
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.Implement certificate verification
Implement certificate verification
Always implement
VerifyX509Certificate or VerifyCertificateEx. At minimum, reject connections with VERIFY_CERT_FLAG_MISMATCH set. Consider pinning the expected fingerprint in FreeRDP_CertificateAcceptedFingerprints.Avoid storing passwords in settings long-term
Avoid storing passwords in settings long-term
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.Keep the TLS backend up to date
Keep the TLS backend up to date
FreeRDP inherits the TLS implementation from its backend. Ensure OpenSSL / MbedTLS is current to benefit from security patches.
