suport client certificate validation per listenner, with a supplied static callback

httptests
UbitUmarov 2016-12-09 04:07:06 +00:00
parent 806e75eefb
commit 6627da693e
3 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,7 @@ using System.Collections.Specialized;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Reflection; using System.Reflection;
using System.Globalization; using System.Globalization;
@ -114,6 +115,7 @@ namespace OpenSim.Framework.Servers.HttpServer
protected List<string> m_certNames = new List<string>(); protected List<string> m_certNames = new List<string>();
protected List<string> m_certIPs = new List<string>(); protected List<string> m_certIPs = new List<string>();
protected string m_certCN= ""; protected string m_certCN= "";
protected RemoteCertificateValidationCallback m_certificateValidationCallback = null;
protected IPAddress m_listenIPAddress = IPAddress.Any; protected IPAddress m_listenIPAddress = IPAddress.Any;
@ -2076,6 +2078,8 @@ namespace OpenSim.Framework.Servers.HttpServer
//m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/"); //m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/");
//m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); //m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
m_httpListener2 = CoolHTTPListener.Create(IPAddress.Any, (int)m_port, m_cert); m_httpListener2 = CoolHTTPListener.Create(IPAddress.Any, (int)m_port, m_cert);
if(m_certificateValidationCallback != null)
m_httpListener2.CertificateValidationCallback = m_certificateValidationCallback;
m_httpListener2.ExceptionThrown += httpServerException; m_httpListener2.ExceptionThrown += httpServerException;
m_httpListener2.LogWriter = httpserverlog; m_httpListener2.LogWriter = httpserverlog;
} }

Binary file not shown.

Binary file not shown.