Package javax.net.ssl

Examples of javax.net.ssl.SSLSocket.startHandshake()


            }
            if (suites != null)
                sslSocket.setEnabledCipherSuites(suites);
            if (protocols != null)
                sslSocket.setEnabledProtocols(protocols);
            sslSocket.startHandshake();
        }
        return socket;
    }

    /**
 
View Full Code Here


        throws IOException
    {
        final String hostName = address.getHostName();
        final SSLSocket sslSocket = (SSLSocket)
            m_factory.createSocket( bareSocket, hostName, port, true );
        sslSocket.startHandshake();
        final SSLSession session = sslSocket.getSession();
        final String DN =
            session.getPeerCertificateChain()[ 0 ].getSubjectDN().getName();
        final String CN = getCN( DN );
        if( !hostName.equals( CN ) )
View Full Code Here

            try {
                SSLSocket sslSock = (SSLSocket) sock;
                sslSock.setNeedClientAuth(true);
                this.handshakeCompletedListener = new HandshakeCompletedListenerImpl(this);
                sslSock.addHandshakeCompletedListener(this.handshakeCompletedListener);
                sslSock.startHandshake();
            } catch (SSLHandshakeException ex) {
                throw new IOException(ex.getMessage());
            }
        }
       
View Full Code Here

        sslSocket = (SSLSocket) getSocketFactoryImpl().createSocket(socket,
                host, port, true);

        sslSocket.addHandshakeCompletedListener(this);
        sslSocket.startHandshake();
        verify(host, sslSocket.getSession());

        return sslSocket;
    }
View Full Code Here

        SSLSocket socket;

        socket = (SSLSocket) getSocketFactoryImpl().createSocket(host, port);

        socket.addHandshakeCompletedListener(this);
        socket.startHandshake();

// unsaved@users
// For https protocol, the protocol handler should do this verification
// (Sun's implementation does), but if we do not use the Protocol
// handler (which is only available in Java >= 1.4), then we need to do
View Full Code Here

                }
                this.handshakeCompletedListener = new HandshakeCompletedListenerImpl(
                        this);
                sslSock
                        .addHandshakeCompletedListener(this.handshakeCompletedListener);
                sslSock.startHandshake();
            } catch (SSLHandshakeException ex) {
                throw new IOException(ex.getMessage());
            }
        }
View Full Code Here

                    = new HandshakeCompletedListenerImpl(channel);

            channel.setHandshakeCompletedListener(listner);
            sslsock.addHandshakeCompletedListener(listner);
            sslsock.setEnabledProtocols(sipStack.getEnabledProtocols());
            sslsock.startHandshake();

            if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
                this.logger.logDebug(
                        "Handshake passed");
            }
View Full Code Here

                        ((TLSMessageChannel) messageChannel)
                                .setHandshakeCompletedListener(listner);
                        sslsock.addHandshakeCompletedListener(listner);
                        sslsock.setEnabledProtocols(sipStack
                                .getEnabledProtocols());
                        sslsock.startHandshake();
                        if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
                            this.logger.logDebug(
                                    "Handshake passed");
                        }
                        // allow application to enforce policy by validating the
View Full Code Here

                        ((TLSMessageChannel) messageChannel)
                                .setHandshakeCompletedListener(listner);
                        sslsock.addHandshakeCompletedListener(listner);
                        sslsock.setEnabledProtocols(sipStack
                                .getEnabledProtocols());
                        sslsock.startHandshake();
                        if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
                            this.logger.logDebug(
                                    "Handshake passed");
                        }
                        writeChunks(outputStream, bytes, length);
View Full Code Here

       
        InputStream is = socket.getInputStream();

        // Make sure the NIO connector has read the request before the handshake
        Thread.sleep(100);
        socket.startHandshake();
        handshakeDone = false;
        byte[] b = new byte[0];
        int maxTries = 5// 5 sec should be enough - in NIO we'll timeout
        socket.setSoTimeout(1000);
        for (int i = 0; i < maxTries; i++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.