public HttpConnection (Socket sock, EndPointListener epl, bool secure, X509Certificate2 cert, AsymmetricAlgorithm key)
{
this.sock = sock;
this.epl = epl;
this.secure = secure;
this.key = key;
if (secure == false) {
stream = new NetworkStream (sock, false);
} else {
#if EMBEDDED_IN_1_0
throw new NotImplementedException ();
#else
SslServerStream ssl_stream = new SslServerStream (new NetworkStream (sock, false), cert, false, false);
ssl_stream.PrivateKeyCertSelectionDelegate += OnPVKSelection;
stream = ssl_stream;
#endif
}
Init ();
}