C#/XAMLでWindows Store Appを開発しております。
https環境にWCFにサービスを配置し、接続したいのですが、うまくできません。
サーバーには自己証明書が配置されています。
WindowsFormAppからですと、OnRemoteCertificateValidationCallbackを以下のように使用して自己証明書の警告を無視することができます。
private bool OnRemoteCertificateValidationCallback(
Object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
return true;
}
WinRTでは上記のクラスはサポートされていないようです。
サービスを呼び出すと、以下のExceptionが発生してしまいます。
Exception:SecurityNegotiationException
Message:Could not establish trust relationship for the SSL/TLS secure channel with authority 'XXX.XXX.XXX.XXX'.
Windows Store Appから自己証明書で生成されているhttps環境のWCFサービスを呼び出すことはできないのでしょうか?
ご教示願います。