public override Java.Net.Socket CreateSocket()
        {
            SSLSocket socket = (SSLSocket)factory.CreateSocket();

            socket.SetEnabledProtocols(socket.GetSupportedProtocols());
            socket.SetEnabledCipherSuites(socket.GetSupportedCipherSuites());

            return(socket);
        }
        public override Java.Net.Socket CreateSocket(string host, int port, Java.Net.InetAddress localHost, int localPort)
        {
            SSLSocket socket = (SSLSocket)factory.CreateSocket(host, port, localHost, localPort);

            socket.SetEnabledProtocols(socket.GetSupportedProtocols());
            socket.SetEnabledCipherSuites(socket.GetSupportedCipherSuites());

            return(socket);
        }
        public override Java.Net.Socket CreateSocket(Java.Net.Socket s, string host, int port, bool autoClose)
        {
            SSLSocket socket = (SSLSocket)factory.CreateSocket(s, host, port, autoClose);

            socket.SetEnabledProtocols(socket.GetSupportedProtocols());
            socket.SetEnabledCipherSuites(socket.GetSupportedCipherSuites());

            return(socket);
        }
示例#4
0
        /// <exception cref="System.IO.IOException"></exception>
        public virtual System.Net.Sockets.Socket CreateLayeredSocket(System.Net.Sockets.Socket
                                                                     socket, string target, int port, HttpContext context)
        {
            SSLSocket sslsock = (SSLSocket)this.socketfactory.CreateSocket(socket, target, port
                                                                           , true);

            if (supportedProtocols != null)
            {
                sslsock.SetEnabledProtocols(supportedProtocols);
            }
            if (supportedCipherSuites != null)
            {
                sslsock.SetEnabledCipherSuites(supportedCipherSuites);
            }
            PrepareSocket(sslsock);
            sslsock.StartHandshake();
            VerifyHostname(sslsock, target);
            return(sslsock);
        }