星期四, 3月 25, 2010

mono 與 ssl

昨天在試 dotplurk 時,遇到了這個錯誤: unhandled Exception: System.Net.WebException: Error getting response stream (Trust failure): TrustFailure 。

循線追查,根據這篇:UsingTrustedRootsRespectfully,首先認為可能是 dotplurk 沒有做遇到未知憑證的處理。但是後來想想不對,因為 Browser 並沒有報遇到未知憑證的錯誤。

再繼續找,才又在這篇FAQ: Security,找到正解!因為 Mono 預設是不信任所有憑證的!!
That's probably because you do not trust the site you are connecting to. Note that a default installation of Mono doesn't trust anyone! 


那麼該怎麼解決呢?我後來是根據FAQ: Security所提供的第3種方法:以 mozroots.exe 去安裝 Mozilla 所有的根憑證就解決了。

微軟的 .Net famework 預設似乎是使用 IE 的,所以除非遇到未知的憑證,否則是不會遇到這種問題的。

沒有留言: