From 2300d56f688c2515def000fbd2330ad9e0116d33 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 6 Jan 2015 22:36:42 -0500 Subject: Ssl in mediabrowser against new listener. --- .../HttpServer/HttpListenerHost.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs') diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index c3228db92..0c0922800 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -44,6 +44,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer private readonly bool _supportsNativeWebSocket; + private string _certificatePath; + /// /// Gets the local end points. /// @@ -217,10 +219,12 @@ namespace MediaBrowser.Server.Implementations.HttpServer { if (_supportsNativeWebSocket && NativeWebSocket.IsSupported) { + // Certificate location is ignored here. You need to use netsh + // to assign the certificate to the proper port. return new HttpListenerServer(_logger, OnRequestReceived); } - return new WebSocketSharpListener(_logger, OnRequestReceived); + return new WebSocketSharpListener(_logger, OnRequestReceived, _certificatePath); } private void WebSocketHandler(WebSocketConnectEventArgs args) @@ -425,8 +429,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer GC.SuppressFinalize(this); } - public void StartServer(IEnumerable urlPrefixes) + public void StartServer(IEnumerable urlPrefixes, string certificatePath) { + _certificatePath = certificatePath; UrlPrefixes = urlPrefixes.ToList(); Start(UrlPrefixes.First()); } -- cgit v1.2.3