Beispiel #1
0
        protected override MonoNewTlsStream Start(Socket socket, TlsSettings settings)
        {
                        #if FIXME
            var monoParams = Parameters as IMonoServerParameters;
            if (monoParams != null)
            {
                settings.Instrumentation = monoParams.ServerInstrumentation;
            }
                        #endif

            settings.ClientCertValidationCallback = ClientCertValidationCallback;

            var stream = new NetworkStream(socket);
            return(MonoNewTlsStreamFactory.CreateServer(
                       stream, false, null, null, EncryptionPolicy.RequireEncryption, settings,
                       Certificate.Certificate, false, SslProtocols.Tls12, false));
        }
Beispiel #2
0
        protected override MonoNewTlsStream Start(Socket socket, TlsSettings settings)
        {
            Debug("Connected.");

            var clientCerts = new X509Certificate2Collection();

            if (Parameters.ClientCertificate != null)
            {
                var clientCert = (ClientCertificate)Parameters.ClientCertificate;
                clientCerts.Add(clientCert.Certificate);
            }

            var targetHost = "Hamiller-Tube.local";

            var stream = new NetworkStream(socket);

            return(MonoNewTlsStreamFactory.CreateClient(
                       stream, false, RemoteValidationCallback, null, EncryptionPolicy.RequireEncryption, settings,
                       targetHost, clientCerts, SslProtocols.Tls12, false));
        }