WCF分布式開發常見錯誤(26):Authentication failed because the remote party has closed the transport stream.
這個也是WCF分布式安全開發實踐過程裡常見的錯誤。 驗證失敗,因為遠端 已經關閉傳輸串流。
WCF 傳輸安全模式下,用戶端和伺服器端使用認證進行驗 證。WSHttpBinding.啟動服務宿主程式。
在進行用戶端加入服務參考的時候 遇到的錯誤。導致用戶端無法添加服務中繼資料引用。這個問題我尋找完畢後解決 了。現在整理一下好給大家參考。
【1】錯誤資訊:
There was an error downloading 'https://frank-xu2009:8001/mex'.
The underlying connection was closed: An unexpected error occurred on a send.
Authentication failed because the remote party has closed the transport stream.
Metadata contains a reference that cannot be resolved: 'https://frank-xu2009:8001/mex'.
An error occurred while making the HTTP request to https://frank-xu2009:8001/mex.
This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.The underlying connection was closed: An unexpected error occurred on a send.
Authentication failed because the remote party has closed the transport stream.
If the service is defined in the current solution, try building the solution and adding the service reference again.
【2】中文翻譯:
從'https://frank-xu2009:8001/mex' 下載時出現錯誤。
基礎串連關閉:一個意外錯誤發生在發送時。
驗證失敗 因為遠端關閉了傳輸串流。
中繼資料套件含的引用不能解析'https://frank- xu2009:8001/mex',
當向https://frank-xu2009:8001/mex發送HTTP請求的時 候出現錯誤。
這個可能是由於伺服器憑證沒有與HTTP.SYS正確配置。
這個 可能是由於用戶端和服務端之間的綁定不匹配所致,基礎串連關閉:一個意外錯 誤發生在發送時。
驗證失敗因為遠端關閉了傳輸串流。 如果服務業在此解決方案裡定義,請編譯 此解決方案然後重新加入服務參考。
【3】問題分析:
和這個問題的解決 方式一樣:http://social.microsoft.com/Forums/zh- CN/wcfzhchs/thread/54450aa5-27c8-480b-bcfb-e51f7a1e9e35。
主要還是證 書的設定不對。用戶端提供的認證出錯。製作的用戶端認證要安裝到伺服器憑證 信任的儲存區。