1

Does silverlight support SSL in oob mode? I have SSL turned on and it works fine in browser, but it doesnt connect oob mode. Is there something I am missing?

Thanks

EDIT:

_serviceHost = new ServiceHost(typeof(ApplicationService), new Uri(BaseAddress));

_serviceHost.Description.Behaviors.Add(new ServiceMetadataBehavior { HttpsGetEnabled = true });

var serviceBinding = new BasicHttpBinding(BasicHttpSecurityMode.Transport)
{
    MessageEncoding = WSMessageEncoding.Text,
    TextEncoding = Encoding.UTF8,
    BypassProxyOnLocal = false,
    UseDefaultWebProxy = true,
    CloseTimeout = new TimeSpan(10, 0, 0),
    OpenTimeout = new TimeSpan(10, 0, 0),
    SendTimeout = new TimeSpan(10, 0, 0),
    ReceiveTimeout = new TimeSpan(10, 0, 0),
    HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
    MaxBufferPoolSize = int.MaxValue,
    MaxReceivedMessageSize = int.MaxValue,
    AllowCookies = false,
    TransferMode = TransferMode.StreamedResponse,
    ReaderQuotas =
    {
        MaxDepth = 32,
        MaxStringContentLength = int.MaxValue,
        MaxArrayLength = 6553600,
        MaxBytesPerRead = 4096,
        MaxNameTableCharCount = 16384
    }
};

var policyRetrieverBinding = new WebHttpBinding(WebHttpSecurityMode.Transport)
{
    BypassProxyOnLocal = false,
    UseDefaultWebProxy = true,
    CloseTimeout = new TimeSpan(10, 0, 0),
    OpenTimeout = new TimeSpan(10, 0, 0),
    SendTimeout = new TimeSpan(10, 0, 0),
    ReceiveTimeout = new TimeSpan(10, 0, 0),
    HostNameComparisonMode = HostNameComparisonMode.StrongWildcard,
    MaxBufferPoolSize = int.MaxValue,
    MaxReceivedMessageSize = int.MaxValue,
    AllowCookies = false,
    TransferMode = TransferMode.StreamedResponse,
    ReaderQuotas =
    {
        MaxDepth = 32,
        MaxStringContentLength = int.MaxValue,
        MaxArrayLength = 6553600,
        MaxBytesPerRead = 4096,
        MaxNameTableCharCount = 16384
    }
};

//service endpoint
_serviceHost.AddServiceEndpoint(typeof(IApplicationService), serviceBinding, ServiceEndPoint);

//mex endpoint for metadata
_serviceHost.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpsBinding(), "mex");

//policy retriever endpoint
_serviceHost.AddServiceEndpoint(typeof(IPolicyRetriever), policyRetrieverBinding, string.Empty)
    .Behaviors.Add(new WebHttpBehavior());

//so we get detailed exceptions
_serviceHost.Description.Behaviors.Find<ServiceDebugBehavior>()
    .IncludeExceptionDetailInFaults = true;

_serviceHost.Open();

The service endpoint is configured to use :

"https://" + Environment.MachineName
jv42
  • 8,521
  • 5
  • 40
  • 64
spyter
  • 727
  • 1
  • 9
  • 25
  • What is supposed to work/is not working? Hosting? Downloading something? REST exchange? WCF? – jv42 Sep 15 '12 at 16:22
  • trying to connect to a WCF service via https. it works fine in browser, but not oob mode. – spyter Sep 17 '12 at 13:24
  • What's happening exactly? Have you tried Fiddler or Wireshark? – jv42 Sep 17 '12 at 13:35
  • Well originally I had it connected to a WCF service via http. it worked fine. I added the transport security to it and made the service https. Now it works fine when I hit it while the silverlight application is running in browser mode, but if i try to run it out of browser it doesnt work and says the expected response was invalid. – spyter Sep 17 '12 at 14:09
  • @jv42 - i did try to run fiddler with it and it works out of browser with fiddler. but if i dont run fiddler, it doesnt work. :/ – spyter Sep 17 '12 at 14:10
  • i do know that silverlight uses the browsers http stack while its in browser mode and a client stack when its oob mode. Does the client stack not support SSL? – spyter Sep 17 '12 at 14:12
  • No, I'm sure SSL is supported in both stacks. – jv42 Sep 17 '12 at 14:29
  • 1
    But maybe you've setup Silverlight to use the client stack or the browser stack for only one of HTTP vs HTTPS. Code similar to: `WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);` – jv42 Sep 17 '12 at 14:29
  • @jv42 thanks for getting back! I havent set up anything like that in the code. I will post my service info above in an edit. – spyter Sep 17 '12 at 16:44
  • so basically above i have the "" endpoint which has my clientaccess and crossdomain xml files, i have the /basic address which is just my main endpoint and i have the mex endpoint. they are all using https://mymachinename/[endpoint] – spyter Sep 17 '12 at 16:48
  • this all works with no hitches in the browser, but out of browser, its not. Thanks again in advance!! any help/comments is very much appreciated!!!! – spyter Sep 17 '12 at 16:48
  • I have no real advice, sorry, I haven't used WCF that much. – jv42 Sep 17 '12 at 18:30

0 Answers0