참고: 이 페이지에 대 한 정보는 AD FS 2012 r 2와 나중에 적용 됩니다.
웹 응용 프로그램 프록시 (WAP)를 배포 하는 경우 WAP 서버와 AD FS 서버에 프록시 트러스트 관계가 설정 되어야 합니다. 프록시 트러스트 관계 설정 하거나 시작 시간에 특정 지점에서 실패를 확인 합니다.
웹 응용 프로그램 프록시 사이의 AD FS 프록시 트러스트 관계를 확인 합니다.
배경 정보
프록시 트러스트 관계는 클라이언트 인증서를 기반으로 합니다. 웹 응용 프로그램 프록시 설치 후 마법사를 실행 하면 마법사는 마법사에서 지정한 자격 증명을 사용 하 여 자체 서명 된 클라이언트 인증서를 만듭니다. 그런 다음 마법사 인증서는 AD FS 구성 데이터베이스에 삽입 하는 AD FS 서버에 AdfsTrustedDevices 인증서 저장소에 추가 합니다.
SSL 통신의 경우 http.sys SSL 인증서 바인딩 위한 다음과 같은 우선 순위를 사용 하 여 인증서와 일치 하도록.
우선 순위 |
이름 |
매개 변수 |
설명 |
1 |
IP |
IP:port |
정확한 IP 및 포트 일치 |
2 |
SNI |
Hostname:port |
정확한 호스트 이름 일치 (연결 SNI를 지정 해야 합니다) |
3 |
CCS |
포트 |
중앙 저장소를 호출 합니다. |
4 |
IPv6 와일드 카드 |
포트 |
IPv6 와일드 카드 일치 (IPv6 연결 이어야 함) |
5 |
IP 와일드 카드 |
포트 |
와일드 카드 일치 IP (연결 가능 IPv4 또는 IPv6) |
AD FS 2012 R2 위에 http.sys 서비스 독립적으로 실행 하 고 인터넷 정보 서비스 (IIS)는 나중에. AD FS hostname:port SSL 인증서 바인딩은 사용 합니다. 클라이언트 인증서 인증을 하는 동안 AD FS AdfsTrustedDevices 저장소에 따라 인증서 신뢰 목록 (CTL)을 보냅니다. ADFS 서버에 대 한 SSL 인증서 바인딩을 사용 하는 ip: port AdfsTrustedDevices 없는 CTL 저장소 인 경우 프록시 트러스트 관계가 설정 되지 않을 수 있습니다.
Adfs에 대 한 SSL 인증서 바인딩을 가져옵니다.
ADFS 서버에서 Windows PowerShell 다음 명령을 실행 합니다.
netsh http show sslcert
반환 된 바인딩 목록의 사용자에 게 5d89a20c-beab-4389-9447-324788eb944a을 찾습니다. 건강 바인딩의 예는 다음과 같습니다. 굵게 표시 된 부분에 note입니다.
Hostname:port : adfs.contoso.com:443
Certificate Hash : 3638de9b03a488341dfe32fc3ae5c480ee687793
Application ID : {5d89a20c-beab-4389-9447-324788eb944a}
Certificate Store Name : MY
Verify Client Certificate Revocation : Enabled
Verify Revocation Using Cached Client Certificate Only : Disabled
Usage Check : Enabled
Revocation Freshness Time : 0
URL Retrieval Timeout : 0
Ctl Identifier : (null)
Ctl Store Name : AdfsTrustedDevices
DS Mapper Usage : Disabled
Negotiate Client Certificate : Disabled
문제 해결
프록시 트러스트 관계 문제를 자동으로 검색 하려면 다음 스크립트를 실행 합니다. 그에 따라 조치를 취할 검색 문제에 따라, 페이지의 끝입니다.
문제를 검색 하 고 프록시 트러스트를 수정 하는 스크립트
param
(
[switch]$syncproxytrustcerts
)
function checkhttpsyscertbindings()
{
Write-Host; Write-Host("1 – Checking http.sys certificate bindings for potential issues")
$httpsslcertoutput = netsh http show sslcert
$adfsservicefqdn = (Get-AdfsProperties).HostName
$i = 1
$certbindingissuedetected = $false
While($i -lt $httpsslcertoutput.count)
{
$ipport = $false
$hostnameport = $false
if ( ( $httpsslcertoutput[$i] -match "IP:port" ) ) { $ipport = $true }
elseif ( ( $httpsslcertoutput[$i] -match "Hostname:port" ) ) { $hostnameport = $true }
# Check for IP specific certificate bindings
if ( ( $ipport -eq $true ) )
{
$httpsslcertoutput[$i]
$ipbindingparsed = $httpsslcertoutput[$i].split(":")
if ( ( $ipbindingparsed[2].trim() -ne "0.0.0.0" ) -and ( $ipbindingparsed[3].trim() -eq "443") )
{
$warning = "There is an IP specific binding on IP " + $ipbindingparsed[2].trim() + " which may conflict with the AD FS port 443 cert binding." | Write-Warning
$certbindingissuedetected = $true
}
$i = $i + 14
continue
}
# check that CTL Store is set for ADFS service binding
elseif ( $hostnameport -eq $true )
{
$httpsslcertoutput[$i]
$ipbindingparsed = $httpsslcertoutput[$i].split(":")
If ( ( $ipbindingparsed[2].trim() -eq $adfsservicefqdn ) -and ( $ipbindingparsed[3].trim() -eq "443") -and ( $httpsslcertoutput[$i+10].split(":")[1].trim() -ne "AdfsTrustedDevices" ) )
{
Write-Warning "ADFS Service binding does not have CTL Store Name set to AdfsTrustedDevices"
$certbindingissuedetected = $true
}
$i = $i + 14
continue
}
$i++
}
If ( $certbindingissuedetected -eq $false ) { Write-Host "Check Passed: No certificate binding issues detected" }
}
function checkadfstrusteddevicesstore()
{
# check for CA issued (non-self signed) certs in the AdfsTrustedDevices cert store
Write-Host; Write-Host "2 – Checking AdfsTrustedDevices cert store for non-self signed certificates"
$certlist = Get-Childitem cert:\LocalMachine\AdfsTrustedDevices -recurse | Where-Object {$_.Issuer -ne $_.Subject}
If ( $certlist.count -gt 0 )
{
Write-Warning "The following non-self signed certificates are present in the AdfsTrustedDevices store and should be removed"
$certlist | Format-List Subject
}
Else { Write-Host "Check Passed: No non-self signed certs present in AdfsTrustedDevices cert store" }
}
function checkproxytrustcerts
{
Param ([bool]$repair=$false)
Write-Host; Write-Host("3 – Checking AdfsTrustedDevices cert store is in sync with ADFS Proxy Trust config")
$doc = new-object Xml
$doc.Load("$env:windir\ADFS\Microsoft.IdentityServer.Servicehost.exe.config")
$connString = $doc.configuration.'microsoft.identityServer.service'.policystore.connectionString
$command = "Select ServiceSettingsData from [IdentityServerPolicy].[ServiceSettings]"
$cli = new-object System.Data.SqlClient.SqlConnection
$cli.ConnectionString = $connString
$cmd = new-object System.Data.SqlClient.SqlCommand
$cmd.CommandText = $command
$cmd.Connection = $cli
$cli.Open()
$configString = $cmd.ExecuteScalar()
$configXml = new-object XML
$configXml.LoadXml($configString)
$rawCerts = $configXml.ServiceSettingsData.SecurityTokenService.ProxyTrustConfiguration._subjectNameIndex.KeyValueOfstringArrayOfX509Certificate29zVOn6VQ.Value.X509Certificate2
#$ctl = dir cert:\LocalMachine\ADFSTrustedDevices
$store = new-object System.Security.Cryptography.X509Certificates.X509Store("ADFSTrustedDevices","LocalMachine")
$store.open("MaxAllowed")
$atLeastOneMismatch = $false
$badCerts = @()
foreach($rawCert in $rawCerts)
{
$rawCertBytes = [System.Convert]::FromBase64String($rawCert.RawData.'#text')
$cert=New-Object System.Security.Cryptography.X509Certificates.X509Certificate2(,$rawCertBytes)
$now = Get-Date
if ( ($cert.NotBefore -lt $now) -and ($cert.NotAfter -gt $now))
{
$certThumbprint = $cert.Thumbprint
$certSubject = $cert.Subject
$ctlMatch = dir cert:\localmachine\ADFSTrustedDevices\$certThumbprint -ErrorAction SilentlyContinue
if ($ctlMatch -eq $null)
{
$atLeastOneMismatch = $true
Write-Warning "This cert is NOT in the CTL: $certThumbprint – $certSubject"
if ($repair -eq $true)
{
write-Warning "Attempting to repair"
$store.Add($cert)
Write-Warning "Repair successful"
}
else
{
Write-Warning ("Please install KB.2964735 or re-run script with -syncproxytrustcerts switch to add missing Proxy Trust certs to AdfsTrustedDevices cert store")
}
}
}
}
$store.Close()
if ($atLeastOneMismatch -eq $false)
{
Write-Host("Check Passed: No mismatched certs found. CTL is in sync with DB content")
}
}
checkhttpsyscertbindings
checkadfstrusteddevicesstore
checkproxytrustcerts($syncproxytrustcerts)
Write-Host; Write-Host("All checks completed.")
검색 문제는 무엇입니까?