我已經在Visual Studio 2013年 寫了一個ASMX Web服務的WS使用HTTPS和X.509認證連接到供應商。Web服務返回的SSL/TLS錯誤
我試圖連接使用「basicHttpBinding的」和「basicHttpsBinding」(Web.config文件),但總是得到下面的錯誤。
錯誤:System.ServiceModel.Security.SecurityNegotiationException:無法建立與權威 'www.providers-site.se' 爲SSL/TLS安全通道。 ---> System.Net.WebException:請求被中止:無法創建SSL/TLS安全通道。在System.Net.HttpWebRequest.GetResponse()在....
我創建了一個行爲的X.509和端點結合,見下文。 我在做什麼錯? 我會使用wsHttpBinding而不是受益嗎?
<behaviors>
<endpointBehaviors>
<behavior name="CertBehaviour">
<clientCredentials>
<clientCertificate findValue="MyCertCN" storeLocation="LocalMachine"
storeName="My" x509FindType="FindBySubjectName" />
<serviceCertificate>
<authentication certificateValidationMode="PeerTrust" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
...
<basicHttpsBinding>
<binding name="mySoapBinding">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
<message clientCredentialType="Certificate" />
</security>
</binding>
</basicHttpsBinding>
...
<client>
<endpoint address="https://www.providers-site.se/na/na_epersondata/services/personpostXML"
behaviorConfiguration="CertBehaviour" binding="basicHttpsBinding"
bindingConfiguration="mySoapBinding" contract="webservice.NaPersonPostXMLWS"
name="personpostXML" />
</client>
我確實運行過一個跟蹤。感謝Mike Cheel! See trace here.
這是否意味着跟蹤的證書不是由遠程主機(提供商)接受? (行67-71) (由於「AUTHENTICATE_REQUEST NOTIFICATION_CONTINUE」和「AnonymousAuthenticationModule」證書認證後啓動。)
CertificateMappingAuthenticationModule NOTIFY_MODULE_START RequestNotifications AUTHENTICATE_REQUEST
AUTH_START Authentication MapCliCert
AUTH_END Authentication
CertificateMappingAuthenticationModule NOTIFY_MODULE_END RequestNotifications AUTHENTICATE_REQUEST NOTIFICATION_CONTINUE
AnonymousAuthenticationModule NOTIFY_MODULE_START RequestNotifications AUTHENTICATE_REQUEST
你有跟蹤嗎? –
嗨,邁克!對不起,我對IIS7不太舒服。我如何執行跟蹤?我查看了下面的鏈接,但是我的屏幕與「禁用ASP:」部分中的屏幕截圖完全不同。 http://www.iis.net/learn/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis – Kermit
我沒有運行跟蹤,但無法看到它出錯。我應該尋找什麼? – Kermit