diff options
author | BlueWall | 2011-05-01 14:44:09 -0400 |
---|---|---|
committer | BlueWall | 2011-05-05 19:56:54 -0400 |
commit | 8ca793875318efc8db3339b25bf7fa5ddeeac218 (patch) | |
tree | cc860147bdb35f8b9d52325b7b12c9df383f17cd /OpenSim/Framework/Servers | |
parent | fix command display for debugging 'emergency-monitoring' (diff) | |
download | opensim-SC_OLD-8ca793875318efc8db3339b25bf7fa5ddeeac218.zip opensim-SC_OLD-8ca793875318efc8db3339b25bf7fa5ddeeac218.tar.gz opensim-SC_OLD-8ca793875318efc8db3339b25bf7fa5ddeeac218.tar.bz2 opensim-SC_OLD-8ca793875318efc8db3339b25bf7fa5ddeeac218.tar.xz |
Adding ssl support
Adding ssl support for "Out of Band" applications such as the remote
admin module or Robust services
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index ba89e21..598e5d1 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -32,6 +32,7 @@ using System.Collections.Specialized; | |||
32 | using System.IO; | 32 | using System.IO; |
33 | using System.Net; | 33 | using System.Net; |
34 | using System.Net.Sockets; | 34 | using System.Net.Sockets; |
35 | using System.Security.Cryptography.X509Certificates; | ||
35 | using System.Reflection; | 36 | using System.Reflection; |
36 | using System.Globalization; | 37 | using System.Globalization; |
37 | using System.Text; | 38 | using System.Text; |
@@ -72,6 +73,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
72 | protected uint m_port; | 73 | protected uint m_port; |
73 | protected uint m_sslport; | 74 | protected uint m_sslport; |
74 | protected bool m_ssl; | 75 | protected bool m_ssl; |
76 | private X509Certificate2 m_cert; | ||
75 | protected bool m_firstcaps = true; | 77 | protected bool m_firstcaps = true; |
76 | protected string m_SSLCommonName = ""; | 78 | protected string m_SSLCommonName = ""; |
77 | 79 | ||
@@ -123,6 +125,14 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
123 | } | 125 | } |
124 | } | 126 | } |
125 | 127 | ||
128 | public BaseHttpServer(uint port, bool ssl, string CPath, string CPass) : this (port, ssl) | ||
129 | { | ||
130 | if (m_ssl) | ||
131 | { | ||
132 | m_cert = new X509Certificate2(CPath, CPass); | ||
133 | } | ||
134 | } | ||
135 | |||
126 | /// <summary> | 136 | /// <summary> |
127 | /// Add a stream handler to the http server. If the handler already exists, then nothing happens. | 137 | /// Add a stream handler to the http server. If the handler already exists, then nothing happens. |
128 | /// </summary> | 138 | /// </summary> |
@@ -1683,6 +1693,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1683 | try | 1693 | try |
1684 | { | 1694 | { |
1685 | //m_httpListener = new HttpListener(); | 1695 | //m_httpListener = new HttpListener(); |
1696 | |||
1686 | NotSocketErrors = 0; | 1697 | NotSocketErrors = 0; |
1687 | if (!m_ssl) | 1698 | if (!m_ssl) |
1688 | { | 1699 | { |
@@ -1702,6 +1713,9 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1702 | { | 1713 | { |
1703 | //m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/"); | 1714 | //m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/"); |
1704 | //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); | 1715 | //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); |
1716 | m_httpListener2 = CoolHTTPListener.Create(IPAddress.Any, (int)m_port, m_cert); | ||
1717 | m_httpListener2.ExceptionThrown += httpServerException; | ||
1718 | m_httpListener2.LogWriter = httpserverlog; | ||
1705 | } | 1719 | } |
1706 | 1720 | ||
1707 | m_httpListener2.RequestReceived += OnRequest; | 1721 | m_httpListener2.RequestReceived += OnRequest; |