TMG 发布ADFS 3.0 时报错Error Code 64 :Host not avaliable

问题描述

==================

在Office 365混合部署场景下,使用TMG发布ADFS 3.0时报错64 :Host not available

clip_image001

问题原因

==================

当TMG向ADFS获取证书失败时会导致上述错误产生。

ADFS 3.0使用Http.sys来处理客户端http请求,Windows Server 2012 R2的 Http.sys会按照如下顺序查找SSL Binding并根据SSL Binding的设置返回证书给客户端。

Priority

Name

Parameters

Description

1

IP

IP, Port

Exact IP and Port match

2

SNI

Hostname, Port

Exact hostname match (connection must specify SNI)

3

CCS

Port

Invoke Central Certificate Store

4

IPv6 Wildcard

Port

IPv6 wildcard match (connection must be IPv6)

5

IP Wildcard

Port

IP wildcard match (connection can be IPv4 or IPv6)

如果没有符合要求的SSL Binding,则客户端(在本例中为TMG)无法获取正确的证书导致该错误。

解决方法

==================

在ADFS 3.0中设置默认返回证书(IP Wildcard)的SSL binding确保可以返回给客户端正确的证书.

设置方法如下:

在ADFS 3.0服务器运行如下命令设置默认返回证书

netsh http add sslcert ipport=0.0.0.0:443 certhash=certthumprint appid={applicationguid}

其中certhash的值为 默认返回证书的 thumprint。

Appid 的值为ADFS服务的GUID,该值为 {5d89a20c-beab-4389-9447-324788eb944a}

clip_image003

参考文档

如何获取证书指纹https://blogs.technet.com/b/tune_in_to_windows_intune/archive/2013/12/10/get-certificate-thumbprint-using-powershell.aspx

Qitao Xing

微软合作伙伴技术顾问