Package com.sun.grizzly

Examples of com.sun.grizzly.SSLConnectorHandler


            this.handshakeLatch = handshakeLatch;
        }

        @Override
        public void onConnect(IOEvent<Context> ioEvent) {
            SSLConnectorHandler sslConnectorHandler =
                    (SSLConnectorHandler) this.connectorHandler;

            SelectionKey key = ioEvent.attachment().getSelectionKey();

            try {
                sslConnectorHandler.finishConnect(key);

                WorkerThread workerThread =
                        (WorkerThread) Thread.currentThread();

                workerThread.setSSLEngine(sslConnectorHandler.getSSLEngine());

                ThreadAttachment attachment =
                        workerThread.updateAttachment(Mode.SSL_ENGINE);

                key.attach(attachment);

                handshakeAppBuffer = acquireBuffer();
                boolean shake =
                        sslConnectorHandler.handshake(handshakeAppBuffer, true);
                if (shake) {                                    
                    ioEvent.attachment().getSelectorHandler().register(key,
                        SelectionKey.OP_READ);
                else {
                    ioEvent.attachment().getSelectorHandler().
View Full Code Here


        private ConnectorHandler createHandlerTLS(final TargetTuple tt)
                throws IOException {
            final InetSocketAddress remote = tt.getSocketAddress();

            final SSLConnectorHandler connectorHandler =
                    (SSLConnectorHandler) new SSLConnectorHandler(sslContext);

            connectorHandler.setController(clientController);

            final CountDownLatch handshakeDoneLatch = new CountDownLatch(1);

            SSLCallbackHandler<Context> sslCallbackHander = new SSLSharedCallbackHandler(connectorHandler,
                    tt, handshakeDoneLatch);
            try {
                if (tt.getBindIP() == null || tt.getBindIP().equals("")){
                    connectorHandler.connect(remote, sslCallbackHander);
                } else {
                    connectorHandler.connect(remote, tt.getSocketBindAddress(),
                            sslCallbackHander);
                }

                // This makes sure the handshake operations is completed
View Full Code Here

TOP

Related Classes of com.sun.grizzly.SSLConnectorHandler

Copyright © 2018 www.massapicom. 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.