2013-04-01 72 views
2

嘗試通過UAT環境調用webservice時出現以下錯誤。但是在我的本地工作正常。我看到一些評論,因爲它可能是由於虛擬證書,但無法得到答案,所以張貼在這裏。我也是WCF的初學者。 請讓我知道我該如何解決這個問題。System.ServiceModel.Security.SecurityNegotiationException:無法建立具有權限的SSL/TLS安全通道的信任關係

這將是對生產的影響,如果我通過

//Trust all certificates 
     System.Net.ServicePointManager.ServerCertificateValidationCallback = 
      ((sender, certificate, chain, sslPolicyErrors) => true); 

錯誤信任所有說 - System.ServiceModel.Security.SecurityNegotiationException:無法建立與權威的SSL/TLS安全通道的信任關係。 ---> System.Net.WebException:底層連接已關閉:無法建立SSL/TLS安全通道的信任關係。 ---> System.Security.Authentication.AuthenticationException:根據驗證過程,遠程證書無效。

結合是

<basicHttpBinding> 
    <binding name="GLEditServiceSOAP" closeTimeout="00:01:00" openTimeout="00:01:00" 
     receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" 
     bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
     messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
     useDefaultWebProxy="true"> 
     <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
     maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
     <security mode="Transport"> 
     <transport clientCredentialType="None" proxyCredentialType="None" 
      realm="" /> 
     <message clientCredentialType="UserName" algorithmSuite="Default" /> 
     </security> 
    </binding> 

也想知道它是如何工作在我的本地。

+0

您是否嘗試在受信任的證書存儲中添加服務器的證書? – Dhawalk

回答

2

您可以參考這個職位here。正如在文章中提到的,如果您信任帶有SSL的URL或所有組件都託管在公司內部網中,則在證書驗證中始終返回True是安全的。

+0

它不是,因爲證書驗證用於驗證您是否正在與受信任的端點通話。如果你忽視這一點,你可能只是在不知情的情況下與中間的一個人交談 – mlehmk

相關問題