Пытаюсь понять как связаться через https
с объектом который захостил под IIS.
Мне нужна сквозная авторизация и защищенный канал связи.
пробую так
web.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<service>
<wellknown mode="Singleton" type="Server.ServerProxy, Server" objectUri="Service.soap" />
</service>
<channels>
<channel ref="http" useDefaultCredentials="true" />
</channels>
</application>
</system.runtime.remoting>
<system.web>
<compilation>
<assemblies>
<add assembly="System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<identity impersonate="true"/>
<authentication mode="Windows"/>
<authorization>
<allow users="*" />
</authorization>
</system.web>
<system.net>
<settings>
<servicePointManager checkCertificateName="true" />
</settings>
</system.net>
</configuration>
код вызова такой
X509Certificate x509 = GetCert("testCert.cer");
X509CertificateCollection xcol = new X509CertificateCollection();
xcol.Add(x509);
ISimpleObject iService = null;
object remoteObject = null;
try
{
remoteObject = RemotingServices.Connect(typeof(ISimpleObject),
"https://localhost/TIservice/Service.soap");
iService = remoteObject as ISimpleObject;
IDictionary dict = ChannelServices.GetChannelSinkProperties(remoteObject);
dict["clientcertificates"] = xcol;
dict["credentials"] = CredentialCache.DefaultCredentials;
dict["connectiongroupname"] = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
MessageBox.Show(iService).GetString();
}
catch (WebException we)
{
MessageBox.Show(we.Messae);
}
catch (Exception ex)
{
MessageBox.Show(ex.Messae);
}
Получаю WebException
The underlying connection was closed: An unexpected error occurred on a send.
Authentication failed because the remote party has closed the transport strea.
Чего не хватает не пойму?
Искал решение долго но так и не нашел рабчего варианта.