1

silverlight 在 oob 模式下是否支持 SSL?我打开了 SSL,它在浏览器中运行良好,但它不连接 oob 模式。有什么我想念的吗?

谢谢

编辑:

_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();

服务端点配置为使用:

"https://" + Environment.MachineName
4

0 回答 0