2012-06-19 36 views
0

我有一個配置了SSL的Web角色,它具有ReportViewer控件,用於呈現Azure Reporting Services中託管的報表。Azure Web角色上的ReportViewer:底層連接已關閉

當我加載使用的ReportViewer的頁面出現錯誤:

The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure.

這是怎麼回事?

回答

0

這沒有把戲。我將這段代碼放在具有報表查看器的頁面的_Load事件中:

ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(BypassSslCertificateValidation); 


private static bool BypassSslCertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) 
{ 
    return true; //add your validation logic here 
} 
相關問題