aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-01-17 13:17:20 -0500
committerLuke <luke.pulverenti@gmail.com>2015-01-17 13:17:20 -0500
commitbb02d68cebb2379623dda5e7803135d80f15b27f (patch)
treeb0c370ce705ab77b476909a0c7515b6873ca131d /MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
parent7a136349eea53097a4fb9e52de81a32bf2a4e086 (diff)
parent2300d56f688c2515def000fbd2330ad9e0116d33 (diff)
Merge pull request #969 from jabbera/ssl2
Ssl in mediabrowser against new listener.
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs9
1 files changed, 7 insertions, 2 deletions
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;
+
/// <summary>
/// Gets the local end points.
/// </summary>
@@ -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<string> urlPrefixes)
+ public void StartServer(IEnumerable<string> urlPrefixes, string certificatePath)
{
+ _certificatePath = certificatePath;
UrlPrefixes = urlPrefixes.ToList();
Start(UrlPrefixes.First());
}