Windows – Server address requested and the certificate subject do no match

rdpremote-desktop-servicesssl-certificatewindowswindows-server-2012-r2

I'm trying to setup Remote Desktop Gateway (Terminal Service Gateway) on virtual Windows Server 2012 R2. But when connect over internet (from Win7 RDP client) getting an error:

Your computer can't connect to the remote computer because the Remote Desktop Gateway server address requested and the certificate subject do no match.

Here's my configuration:

  • Host is running Windows Server 2008 R2 Std
  • RDG is running Windows Server 2012 R2 Std virtually (I also tried 2008 R2 with equal result)
  • AD is virtual also (dc.domain.local, etc.)
  • Host is server.domain.local
  • Host is running RRAS with NAT so port host:33899 is forwarded to rdg:3389
  • RDG is rdg.domain.local
  • RDG uses self-signed SSL certificate for example.com set in Gateway Manager:

Whatever name I would use for SSL certificate, client sees it with Subject=rdg.domain.local!

enter image description here

I also tried create a self-signed certificate manually using makecert and use/import it but with equal result.

Best Answer

Apparently MS botched the instruction somewhat.

I believe you need to create the cert request in iis manager on the rdg gateway computer. The request needs to specify the fqdn used by the clients to connect over the internet. For processing the request signing you use a CA trusted by your client computers. If you have full control over the client computers you can use your own CA, as long as they trust your CA root certificate. Otherwise use a commercial CA such as Verisign, Thawte or such. After importing the signed cert to iis it should be available for import to your rdg gateway.

It is all documented in the official guide: http://technet.microsoft.com/en-us/library/dd983941%28WS.10%29.aspx

including the helpful if ranting comment at the bottom of http://technet.microsoft.com/en-us/library/dd983949(v=ws.10).aspx

And except apparently this little detail: http://blog.xiquest.com/2010/01/rd-gatewayweb-access-outside-the-firewall/

"Open up “IIS Admin” console from the “Administrative Tools” menu. Navigate to the default web site and configure the “Application Settings” for “Default Web Site\RDWeb\Pages“. Change the following setting: “DefaultTSGateway” = [fqdn of Internet accessible TS Gateway]

Note: make sure this is also the server name listed on your SSL certificate."

I'll tidy up this post as soon as I get behind a proper computer.