Examples of SSLServerSocket


Examples of javax.net.ssl.SSLServerSocket

     * Configures the given SSL server socket with the requested cipher suites,
     * protocol versions, and need for client authentication
     */
    private void initServerSocket(ServerSocket ssocket) {

        SSLServerSocket socket = (SSLServerSocket) ssocket;

        if (enabledCiphers != null) {
            socket.setEnabledCipherSuites(enabledCiphers);
        }

        String requestedProtocols = (String) attributes.get("protocols");
        setEnabledProtocols(socket, getEnabledProtocols(socket,
                                                         requestedProtocols));
View Full Code Here

Examples of javax.net.ssl.SSLServerSocket

                return new ServerSocket(port, backlog);
            }
            else {
                // SSL is required.  Create one from the SSLServerFactory retrieved from the config.  This will
                // require additional QOS configuration after creation.
                SSLServerSocket serverSocket = (SSLServerSocket)getServerSocketFactory().createServerSocket(port, backlog);
                configureServerSocket(serverSocket);
                return serverSocket;
            }
        } catch (IOException ex) {
            log.error("Exception creating a server socket for port "  + port, ex);
View Full Code Here

Examples of javax.net.ssl.SSLServerSocket

                return new ServerSocket(port, backlog, address);
            }
            else {
                // SSL is required.  Create one from the SSLServerFactory retrieved from the config.  This will
                // require additional QOS configuration after creation.
                SSLServerSocket serverSocket = (SSLServerSocket)getServerSocketFactory().createServerSocket(port, backlog, address);
                configureServerSocket(serverSocket);
                return serverSocket;
            }
        } catch (IOException ex) {
            log.error("Exception creating a client socket to "  + address.getHostName() + ":" + port, ex);
View Full Code Here

Examples of javax.net.ssl.SSLServerSocket

     * Configures the given SSL server socket with the requested cipher suites,
     * protocol versions, and need for client authentication
     */
    private void initServerSocket(ServerSocket ssocket) {

        SSLServerSocket socket = (SSLServerSocket) ssocket;

        if (enabledCiphers != null) {
            socket.setEnabledCipherSuites(enabledCiphers);
        }

        String requestedProtocols = (String) attributes.get("protocols");
        setEnabledProtocols(socket, getEnabledProtocols(socket,
                                                         requestedProtocols));
View Full Code Here

Examples of javax.net.ssl.SSLServerSocket

    /* ------------------------------------------------------------ */
    protected ServerSocket newServerSocket(String host, int port,int backlog) throws IOException
    {
        SSLServerSocketFactory factory = null;
        SSLServerSocket socket = null;

        try
        {
            factory = createFactory();

            socket = (SSLServerSocket) (host==null?
                            factory.createServerSocket(port,backlog):
                            factory.createServerSocket(port,backlog,InetAddress.getByName(host)));

            if (_wantClientAuth)
                socket.setWantClientAuth(_wantClientAuth);
            if (_needClientAuth)
                socket.setNeedClientAuth(_needClientAuth);

            if (_excludeCipherSuites != null && _excludeCipherSuites.length >0)
            {
                List excludedCSList = Arrays.asList(_excludeCipherSuites);
                String[] enabledCipherSuites = socket.getEnabledCipherSuites();
              List enabledCSList = new ArrayList(Arrays.asList(enabledCipherSuites));
              Iterator exIter = excludedCSList.iterator();

                while (exIter.hasNext())
              {
                  String cipherName = (String)exIter.next();
                    if (enabledCSList.contains(cipherName))
                    {
                        enabledCSList.remove(cipherName);
                    }
              }
                enabledCipherSuites = (String[])enabledCSList.toArray(new String[enabledCSList.size()]);

                socket.setEnabledCipherSuites(enabledCipherSuites);
            }
           
        }
        catch (IOException e)
        {
View Full Code Here

Examples of javax.net.ssl.SSLServerSocket

  }

  private static TServerSocket createServer(SSLServerSocketFactory factory, int port, int timeout, boolean clientAuth,
                                    InetAddress ifAddress, TSSLTransportParameters params) throws TTransportException {
    try {
      SSLServerSocket serverSocket = (SSLServerSocket) factory.createServerSocket(port, 100, ifAddress);
      serverSocket.setSoTimeout(timeout);
      serverSocket.setNeedClientAuth(clientAuth);
      if (params != null && params.cipherSuites != null) {
        serverSocket.setEnabledCipherSuites(params.cipherSuites);
      }
      return new TServerSocket(serverSocket, timeout);
    } catch (Exception e) {
      throw new TTransportException("Could not bind to port " + port, e);
    }
View Full Code Here

Examples of javax.net.ssl.SSLServerSocket

         this.serverSocketFactory = serverSocketFactory;
      }

      public ServerSocket createServerSocket() throws IOException
      {
         SSLServerSocket ss = (SSLServerSocket) serverSocketFactory.createServerSocket();
         ss.setNeedClientAuth(true);
         return ss;
      }
View Full Code Here

Examples of javax.net.ssl.SSLServerSocket

         return ss;
      }

      public ServerSocket createServerSocket(int arg0) throws IOException
      {
         SSLServerSocket ss = (SSLServerSocket) serverSocketFactory.createServerSocket(arg0);
         ss.setNeedClientAuth(true);
         return ss;
      }
View Full Code Here

Examples of javax.net.ssl.SSLServerSocket

         return ss;
      }

      public ServerSocket createServerSocket(int arg0, int arg1) throws IOException
      {
         SSLServerSocket ss = (SSLServerSocket) serverSocketFactory.createServerSocket(arg0, arg1);
         ss.setNeedClientAuth(true);
         return ss;
      }
View Full Code Here

Examples of javax.net.ssl.SSLServerSocket

         return ss;
      }

      public ServerSocket createServerSocket(int arg0, int arg1, InetAddress arg2) throws IOException
      {
         SSLServerSocket ss = (SSLServerSocket) serverSocketFactory.createServerSocket(arg0, arg1, arg2);
         ss.setNeedClientAuth(true);
         return ss;
       
      }
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.