1

セキュリティポップアップを無効にしようとしましたが、それでもプロンプトが表示されます。

エラーポップアップ:

Do you want to view only the webpage content that was delivered securely This webpage contains content that will not be delivered using a secure HTTPS connection, which could compromise the security of the entire webpage.”“This page contains both secure and nonsecure items. Do you want to display the nonsecure items?”

WPF:

<WebBrowser Name="wbGateway" Width="700" Height="600" 
                        OverridesDefaultStyle="False"
                        ScrollViewer.CanContentScroll="False"
                        ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                        ScrollViewer.VerticalScrollBarVisibility="Hidden"></WebBrowser>

コード:

private void wbGateway_Navigating(object sender, NavigatingCancelEventArgs e)
        {
ServicePointManager.ServerCertificateValidationCallback = new 


RemoteCertificateValidationCallback(ValidateServerCertificate);
}

    public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
    {
        return true;
    }
4

1 に答える 1