diff options
author | Melanie | 2011-05-08 20:20:40 +0100 |
---|---|---|
committer | Melanie | 2011-05-08 20:20:40 +0100 |
commit | 1be67914fab348115faa1fc9e9ecffbf7c303093 (patch) | |
tree | 7ad4917efae6aebeefa51fe03b1d1aac3e95efcb /OpenSim/Framework/Servers/HttpServer | |
parent | Enable compressed (gzip) fatpack transfers. (diff) | |
parent | Mantis #5472 (diff) | |
download | opensim-SC_OLD-1be67914fab348115faa1fc9e9ecffbf7c303093.zip opensim-SC_OLD-1be67914fab348115faa1fc9e9ecffbf7c303093.tar.gz opensim-SC_OLD-1be67914fab348115faa1fc9e9ecffbf7c303093.tar.bz2 opensim-SC_OLD-1be67914fab348115faa1fc9e9ecffbf7c303093.tar.xz |
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Framework/Servers/HttpServer')
-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; |