Overview
FreeRDP verifies the TLS certificate presented by the RDP server before completing the connection. The verification workflow is exposed through callback functions that client implementations can override, and through command-line options that control policy.
Verification workflow
When FreeRDP connects to a server it:
- Receives the server’s TLS certificate chain.
- Checks whether the certificate is already trusted (stored in the known-hosts file or accepted via fingerprint).
- If not already trusted, invokes the
VerifyCertificateEx callback (or VerifyX509Certificate for the full chain).
- Based on the callback return value, either proceeds with the connection, stores the certificate for future sessions, or aborts.
Callback return values
VERIFY_CERT_FLAG flags
The flags parameter passed to the certificate callbacks provides context about why verification is being requested.
Certificate callbacks (API)
Client implementations set callback function pointers on the freerdp instance.
Assign these on the instance before calling freerdp_connect():
Certificate pinning and the known-hosts file
When a user accepts a certificate with return value 1, FreeRDP stores it in a known-hosts file. On subsequent connections the stored entry is compared against the server’s certificate; if it matches, no callback is invoked.
The file location follows platform conventions and is typically found under the user’s FreeRDP configuration directory (e.g., ~/.config/freerdp/known_hosts2 on Linux).
Accepting a fingerprint without prompting
Use the /cert:fingerprint: option to pin a specific certificate hash at connection time:
Multiple fingerprints can be supplied by repeating the option with a comma-separated list.
Command-line certificate options
The /cert option accepts a comma-separated list of sub-options.
/cert:ignore disables all TLS certificate verification. It is suitable only for local
development or testing. Never use it in production — it makes the connection vulnerable to
man-in-the-middle attacks.
Global certificate configuration file
System-wide certificate policy can be set in <sysconf>/certificates.json. This file controls default behavior before the per-user callback is invoked.
Generating test certificates with winpr-makecert
winpr-makecert is a certificate generation tool modeled after the Windows MakeCert utility. It is built when -DWITH_WINPR_TOOLS=ON (the default).
Common options