所以我在连接到Web服务时遇到了一些问题,但是只能通过IIS托管的网站进行。通过浏览器(IE / Chrome)或LinqPad访问Web服务没有问题。使用system.diagnostics查看网络跟踪,即使我的客户端证书被设置也似乎被忽略了(如果在尝试连接之前找不到该证书,则会抛出异常,所以这不是我的问题想)。
考虑到代码在Linqpad上工作正常,我可以从浏览器访问Web服务,我想知道这是IIS问题还是与服务器更新(Windows Server 2012 R2)有关?
以下是网络跟踪中的一些摘要:
System.Net Information: 0 : [3040]
TlsStream#57420154::.ctor(host=***.**.**.***, #certs=0,
checkCertificateRevocationList=False, sslProtocols=Default, Tls11, Tls12)
System.Net Information: 0 : [3040]
SecureChannel#13120424::.ctor(hostname=***.**.**.***,
#clientCertificates=0, encryptionPolicy=RequireEncryption)
System.Net Information: 0 : [3040] SecureChannel#13120424 - Left with 0
client certificates to choose from.
System.Net Error: 0 : [5104] Exception in HttpWebRequest#13834363:: - The
request was aborted: Could not create SSL/TLS secure channel..
System.Net Verbose: 0 : [5104] Entering
HttpWebRequest#13834363::EndGetResponse()
System.Net Error: 0 : [5104] Exception in
HttpWebRequest#13834363::EndGetResponse - The request was aborted: Could
not create SSL/TLS secure channel..
System.Net Verbose: 0 : [5104] Entering HttpWebRequest#13834363::Abort()
System.Net Error: 0 : [5104] Exception in HttpWebRequest#13834363:: - The
request was aborted: The request was canceled..
System.Net Verbose: 0 : [5104] Exiting HttpWebRequest#13834363::Abort()