How do you bind a CA-issued certificate to an RDP listener, and what does the client's warning for the default self-signed one tell users?
answer
- thumbprint, not the file
- property named SSLCertificateSHA1Hash
- machine store, readable by the service
- default is self-signed
- warning is the only identity signal
basics
~20 sImport the certificate into the computer account's Personal store and point the listener at its thumbprint through the SSLCertificateSHA1Hash property or registry value. The default self-signed certificate triggers a warning because the client cannot verify who the server is.
solid answer
~40 sThe listener references its certificate by thumbprint, stored in the `SSLCertificateSHA1Hash` property of the `Win32_TSGeneralSetting` WMI class, or in a registry value of the same name under the `RDP-Tcp` WinStation key. The certificate must first be in the computer account's Personal store, its private key must be readable by NETWORK SERVICE, and it needs the Server Authentication usage and an issuer the clients trust. Until a custom certificate is set, the listener uses a default self-signed one, which clients do not trust by default. The warning is therefore the client reporting that it cannot verify the server's identity. Microsoft says certificates prevent man-in-the-middle attacks by letting the client check the server is authentic; users trained to click through give that check away.
code
powershell · 2 linesGet-WmiObject -Class Win32_TSGeneralSetting -Namespace root\cimv2\terminalservices |
Select-Object SSLCertificateSHA1Hashgo deeper
Know that the default certificate is self-signed and that the client warning means the server's identity could not be verified.
Explain why users should not dismiss the warning, and what a CA-issued certificate that clients trust changes.
Bind a certificate: computer store, key readable by the service, thumbprint in SSLCertificateSHA1Hash, and a renewal plan that updates the thumbprint.
Weigh the cost of running a private authority and distributing its trust to every client class against a fleet trained to ignore warnings.
## What the listener presents When a client negotiates TLS or CredSSP, the server presents a certificate, and the client uses it to verify the server's identity. The Remote Desktop Protocol specification (MS-RDPBCGR section 5.4.5.1) says TLS was added to RDP to enable authentication of the remote computer's identity. If the server has no valid authentication certificate it cannot start the external protocol and answers the client with `SSL_CERT_NOT_ON_SERVER` (0x3). The handshake itself, and how a client builds and checks a chain, belong to other topics; this answer is about which certificate the RDP listener uses and what the client can conclude. ## The default and the replacement Until an administrator sets one, the listener uses a default self-signed certificate. Microsoft's page on listener certificate configuration describes the custom certificate as one "to support TLS instead of using the default self-signed certificate". A self-signed certificate is signed by its own key, so no issuer the client trusts by default vouches for it. The client can still encrypt, but it cannot tell the real server from anything else presenting its own certificate. Binding a certificate issued by a certification authority the clients trust changes that: 1. **Issue the certificate.** The RDS certificates page lists what it must satisfy: Server Authentication (EKU 1.3.6.1.5.5.7.3.1), Enhanced Key Usage and Key Usage extensions, and an issuer trusted by the RDS servers and clients. 2. **Install it in the right store.** Microsoft's page says the certificate must be imported to the **Personal certificate store of the computer account**; without that, setting the property fails with an Invalid Parameter error. 3. **Let the service read the key.** The Remote Desktop Host Services runs under NETWORK SERVICE, so that account needs Read permission on the certificate's private key. 4. **Point the listener at it.** Set `SSLCertificateSHA1Hash` to the certificate's thumbprint, through WMI (class `Win32_TSGeneralSetting`, namespace `root\cimv2\TerminalServices`) or through the registry value `SSLCertificateSHA1Hash`, type `REG_BINARY`, under `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp`. The thumbprint is unique to each certificate. 5. **Make the clients trust the issuer.** A certificate from a private authority only helps if the clients, including kiosk images, hold that authority as trusted. The listener page is written for a server that is not part of an RDS deployment. In a deployment, Microsoft's RDS page configures certificates for the web access, broker and gateway roles through the deployment properties or `Set-RDCertificate`, and points to the listener page for session host certificates. The graphical snap-in route (Remote Desktop Configuration) is no longer available from Windows Server 2012, per the listener page. ## What the client warning means The warning is the client telling the user that it could not verify the server's identity from the certificate it received. With the default self-signed certificate it appears for the legitimate server as well, so it carries no information. Dismissing it habitually has a specific cost: the same dismissal would also be given if a different server presented a certificate of its own. The certificate's protection, in Microsoft's words that it prevents man-in-the-middle attacks by verifying that the server is authentic, is spent. The warning is useful only while users still treat it as a signal. | Situation | What the user sees | What it tells them | |---|---|---| | Default self-signed certificate | A warning on routine connections | Nothing useful; it appears for the legitimate server too | | CA-issued certificate bound to the listener, trusted issuer | No warning | The server's identity checks out | | CA-issued certificate, then something goes wrong | A warning on a rare occasion | Worth stopping for | ## Noticing it on your own estate - **Read the property.** A read-only query of the WMI class shows which thumbprint each listener references; compare it with the certificate you issued. The query shows the thumbprint, not whether the certificate is valid, unexpired or trusted by clients. - **Count warnings.** A help-desk habit of telling users to click through is a finding in itself. - **Plan renewals.** A renewed certificate has a new thumbprint, so the listener must be re-pointed; otherwise it keeps referencing the old certificate. ## What it leaves open A trusted certificate does not choose the TLS version, does not refuse the legacy layer, and does not authenticate the user. A host that still allows Standard RDP Security can still serve a connection on which this listener certificate is not what the client checks.
- Why does the NETWORK SERVICE account appear in the instructions for the listener certificate?Microsoft's page says the Remote Desktop Host Services runs under the NETWORK SERVICE account, so that account needs Read permission on the certificate's private key; the certificate is also required in the computer account's Personal store. A certificate that is imported but whose key the service cannot read cannot be used by the listener, so check the key permission whenever a binding appears to do nothing.
- A certificate renewed last week; some users now see the warning again. What do you check first?Which thumbprint the listener references. The thumbprint is unique to each certificate, so a renewed certificate has a different one, and the property or registry value must be updated to point at it. Then check that the renewed certificate sits in the computer account's Personal store with its key readable, and that the clients still trust its issuer.
A self-signed certificate is a visitor who prints their own ID badge: the badge is legible, but nothing at the door can tell it from a forged one, so guards who wave every badge through no longer check anyone.
- Says the self-signed warning only matters for external connections.
- Thinks a certificate in the user's store is enough for the listener.
- Believes the listener picks the newest valid certificate automatically.
- Treats the warning as cosmetic because the traffic is encrypted anyway.
- Says a CA-issued certificate also protects legacy-layer sessions.