Package javax.net.ssl

Examples of javax.net.ssl.HandshakeCompletedListener


/*     */     }
/*     */
/*     */     try
/*     */     {
/* 136 */       Hashtable env = System.getProperties();
/* 137 */       HandshakeCompletedListener listener = (Serializable)env.get("org.jboss.security.ssl.HandshakeCompletedListener");
/*     */
/* 139 */       if (listener != null)
/* 140 */         listener.handshakeCompleted(event);
/*     */     }
/*     */     catch (Throwable e)
/*     */     {
/* 144 */       log.debug("Failed to foward handshakeCompleted", e);
/*     */     }
View Full Code Here


/*     */     }
/*     */
/*     */     try
/*     */     {
/* 141 */       Hashtable env = System.getProperties();
/* 142 */       HandshakeCompletedListener listener = (Serializable)env.get("org.jboss.security.ssl.HandshakeCompletedListener");
/*     */
/* 144 */       if (listener != null)
/* 145 */         listener.handshakeCompleted(event);
/*     */     }
/*     */     catch (Throwable e)
/*     */     {
/* 149 */       log.debug("Failed to forward handshakeCompleted", e);
/*     */     }
View Full Code Here

/*     */     }
/*     */
/*     */     try
/*     */     {
/* 292 */       Hashtable env = System.getProperties();
/* 293 */       HandshakeCompletedListener listener = (Serializable)env.get("org.jboss.security.ssl.HandshakeCompletedListener");
/*     */
/* 295 */       if (listener != null)
/* 296 */         listener.handshakeCompleted(event);
/*     */     }
/*     */     catch (Throwable e)
/*     */     {
/* 300 */       log.debug("Failed to foward handshakeCompleted", e);
/*     */     }
View Full Code Here

/*     */     {
/* 135 */       Object obj = this.configuration.get("handshakeCompletedListener");
/* 136 */       if ((obj != null) && ((obj instanceof HandshakeCompletedListener)))
/*     */       {
/* 138 */         SSLSocket sslSocket = (SSLSocket)s;
/* 139 */         HandshakeCompletedListener listener = (HandshakeCompletedListener)obj;
/* 140 */         establishHandshake(sslSocket, listener);
/*     */       }
/*     */     }
/*     */
/* 144 */     return s;
View Full Code Here

/*     */
/*  71 */     Object obj = this.configuration.get("handshakeCompletedListener");
/*  72 */     if ((obj != null) && ((obj instanceof HandshakeCompletedListener)))
/*     */     {
/*  74 */       SSLSocket sslSocket = (SSLSocket)s;
/*  75 */       HandshakeCompletedListener listener = (HandshakeCompletedListener)obj;
/*  76 */       establishHandshake(sslSocket, listener);
/*     */     }
/*     */
/*  79 */     return s;
/*     */   }
View Full Code Here

/*     */     {
/* 133 */       Object obj = this.configuration.get("handshakeCompletedListener");
/* 134 */       if ((obj != null) && ((obj instanceof HandshakeCompletedListener)))
/*     */       {
/* 136 */         SSLSocket sslSocket = (SSLSocket)s;
/* 137 */         HandshakeCompletedListener listener = (HandshakeCompletedListener)obj;
/* 138 */         establishHandshake(sslSocket, listener);
/*     */       }
/*     */     }
/*     */
/* 142 */     return s;
View Full Code Here

            log.debug("    cipher suites:");

            for (int i = 0; i < iorSuites.length; i++) {
                log.debug("    " + iorSuites[i]);
            }
            socket.addHandshakeCompletedListener(new HandshakeCompletedListener() {

                public void handshakeCompleted(HandshakeCompletedEvent handshakeCompletedEvent) {
                    Certificate[] certs = handshakeCompletedEvent.getLocalCertificates();
                    if (certs != null) {
                        log.debug("handshake returned local certs count: " + certs.length);
View Full Code Here

                    sock.getInetAddress().getHostAddress(),
                    sock.getPort(),
                    true);

            sslsock.addHandshakeCompletedListener(
                    new HandshakeCompletedListener() {
                       public void handshakeCompleted(
                          final HandshakeCompletedEvent event) {
                          System.out.println("Handshake finished!");
                          System.out.println(
                          "\t CipherSuite:" + event.getCipherSuite());
View Full Code Here

                        "inaddr = " + dst);
                logger.logDebug(
                        "port = " + dstPort);
            }

            HandshakeCompletedListener listner
                    = new HandshakeCompletedListenerImpl(channel);

            channel.setHandshakeCompletedListener(listner);
            sslsock.addHandshakeCompletedListener(listner);
            sslsock.setEnabledProtocols(sipStack.getEnabledProtocols());
View Full Code Here

                            logger.logDebug(
                                    "inaddr = " + receiverAddress);
                            logger.logDebug(
                                    "port = " + contactPort);
                        }
                        HandshakeCompletedListener listner = new HandshakeCompletedListenerImpl(
                                (TLSMessageChannel) messageChannel);
                        ((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
                        // certificate

                        try {
                            sipStack
                                    .getTlsSecurityPolicy()
                                    .enforceTlsPolicy(
                                            messageChannel
                                                    .getEncapsulatedClientTransaction());
                        } catch (SecurityException ex) {
                            throw new IOException(ex.getMessage());
                        }

                        if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
                            this.logger.logDebug(
                                    "TLS Security policy passed");
                        }
                        OutputStream outputStream = clientSock
                                .getOutputStream();
                        writeChunks(outputStream, bytes, length);
                        putSocket(key, clientSock);
                        break;
                    } else {
                        try {
                            OutputStream outputStream = clientSock
                                    .getOutputStream();
                            writeChunks(outputStream, bytes, length);
                            break;
                        } catch (IOException ex) {
                            if (logger.isLoggingEnabled())
                                logger.logException(ex);
                            // old connection is bad.
                            // remove from our table.
                            removeSocket(key);

                            try {
                                logger.logDebug(
                                        "Closing socket");
                                clientSock.close();
                            } catch (Exception e) {
                            }
                            clientSock = null;
                            retry_count++;
                        }
                    }
                }
            } catch (SSLHandshakeException ex) {
                removeSocket(key);
                throw ex;
            } catch (IOException ex) {
                removeSocket(key);

                if (!isClient) {
                    receiverAddress = InetAddress.getByName(messageChannel
                            .getViaHost());
                    contactPort = messageChannel.getViaPort();
                    if (contactPort == -1)
                        contactPort = 5060;

                    key = makeKey(receiverAddress, messageChannel
                            .getViaPort());
                    clientSock = this.getSocket(key);
                    if (clientSock == null) {
                        if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) {
                            logger.logDebug(
                                    "inaddr = " + receiverAddress +
                                    " port = " + contactPort);
                        }
                        SSLSocket sslsock = sipStack.getNetworkLayer().createSSLSocket(
                                receiverAddress, contactPort, senderAddress);
                        OutputStream outputStream = sslsock
                                .getOutputStream();
                        HandshakeCompletedListener listner = new HandshakeCompletedListenerImpl(
                                (TLSMessageChannel) messageChannel);
                        ((TLSMessageChannel) messageChannel)
                                .setHandshakeCompletedListener(listner);
                        sslsock.addHandshakeCompletedListener(listner);
                        sslsock.setEnabledProtocols(sipStack
View Full Code Here

TOP

Related Classes of javax.net.ssl.HandshakeCompletedListener

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.