我想检查一个需要客户端证书认证的网页。我该如何从证书存储中提供我的证书给Web请求?是否可以在凭据或代理中指定此项?
$webclient = New-Object Net.WebClient
# The next 5 lines are required if your network has a proxy server
$webclient.Credentials = [System.Net.CredentialCache]::DefaultCredentials
if($webclient.Proxy -ne $null) {
$webclient.Proxy.Credentials = `
[System.Net.CredentialCache]::DefaultNetworkCredentials
}
# This is the main call
$output = $webclient.DownloadString("$URL")
PS:也许这个链接能帮到你:如何在WebClient (C#)中添加证书? 但是我不太懂...;-)