Package org.mortbay.http

Examples of org.mortbay.http.SslListener


        if (server == null) {
            server = new HttpServer();
           
            if (sslPolicy != null) {
                listener = new SslListener(new InetAddrPort(port));
                SslListener secureListener = (SslListener)listener;
               
                JettySslListenerConfigurer secureListenerConfigurer =
                    new JettySslListenerConfigurer(config, sslPolicy, secureListener);
                secureListenerConfigurer.configure();
View Full Code Here


                                createJettySslListenerConfigurer(sslServerPolicy,
                                                               "https://dummyurl",
                                                               handler);
   
            jettySslListenerConfigurer.configure();
            SslListener sslListener = jettySslListenerConfigurer.getSslListener();
            assertTrue("Keystore not set properly",
                       sslListener.getKeystore().contains("resources/defaultkeystore"));
            String trustStr = System.getProperty("javax.net.ssl.trustStore");
            assertTrue("Trust store loaded success message not present",
                       trustStr.contains("resources/defaulttruststore"));
            assertTrue("Keystore type not being read",
                       sslListener.getKeystoreType().equals("JKS"));
            assertTrue("Keystore password not being read",
                       sslServerPolicy.getKeystorePassword().equals("defaultkeypass"));
            assertTrue("Key password not being read",
                       sslServerPolicy.getKeyPassword().equals("defaultkeypass"))
           
            assertTrue("Ciphersuites is not being read from the config provider",
                       sslListener.getCipherSuites()[0].equals("MyCipher"));
            assertTrue("Truststore type not being read",
                       handler.checkLogContainsString("Unsupported SSLServerPolicy property : "
                                                      + "TrustStoreType"));         
   
            assertTrue("Secure socket protocol not being read",
View Full Code Here

                            createJettySslListenerConfigurer(sslServerPolicy,
                                                           "https://dummyurl",
                                                           handler);

        jettySslListenerConfigurer.configure();
        SslListener sslListener =
                jettySslListenerConfigurer.getSslListener();
       
        assertTrue("Keystore not set properly",
                   sslListener.getKeystore().contains("resources/defaultkeystore"));
        String trustStr = System.getProperty("javax.net.ssl.trustStore");
        assertTrue("Trust store loaded success message not present",
                   trustStr.contains("resources/defaulttruststore"));
        assertTrue("Keystore type not being read",
                   sslListener.getKeystoreType().equals("JKS"));
        assertTrue("Keystore password not being read",
                   sslServerPolicy.getKeystorePassword().equals("defaultkeypass"));
        assertTrue("Key password not being read",
                   sslServerPolicy.getKeyPassword().equals("defaultkeypass"))
       
        assertTrue("Ciphersuites is being being read from somewhere unknown",
                   sslListener.getCipherSuites() == null);
        assertTrue("Truststore type not being read",
                   handler.checkLogContainsString("Unsupported SSLServerPolicy property : "
                                                  + "TrustStoreType"));         

        assertTrue("Secure socket protocol not being read",
View Full Code Here

                            createJettySslListenerConfigurer(sslServerPolicy,
                                                           "https://dummyurl",
                                                           handler);

        jettySslListenerConfigurer.configure();
        SslListener sslListener =
                jettySslListenerConfigurer.getSslListener();
       
        assertTrue("Keystore not set properly, sslListener.getKeystore() = " + sslListener.getKeystore(),
                   sslListener.getKeystore().contains(".keystore"));
        String trustStr = System.getProperty("javax.net.ssl.trustStore");
        assertTrue("Trust store loaded success message not present",
                   trustStr.contains("cacerts"));
        assertTrue("Keystore type not being read",
                   sslListener.getKeystoreType().equals("JKS"));
        assertTrue("Keystore password not being read",
                   sslServerPolicy.getKeystorePassword().equals("defaultkeypass"));
        assertTrue("Key password not being read",
                   sslServerPolicy.getKeyPassword().equals("defaultkeypass"))
       
        assertTrue("Ciphersuites is being being read from somewhere unknown",
                   sslListener.getCipherSuites() == null);
        assertTrue("Truststore type not being read",
                   handler.checkLogContainsString("Unsupported SSLServerPolicy property : "
                                                  + "TrustStoreType"));         

        assertTrue("Secure socket protocol not being read",
View Full Code Here

                                             TestHandler handler) {
        try {
           
           
           
            SslListener sslListener = new SslListener();
            JettySslListenerConfigurer jettySslListenerConfigurer =
                new JettySslListenerConfigurer(configuration,
                                               sslServerPolicy,
                                               sslListener);
           
View Full Code Here

                            createJettySslListenerConfigurer(sslServerPolicy,
                                                           "https://dummyurl",
                                                           handler);

        jettySslListenerConfigurer.configure();
        SslListener sslListener =
                jettySslListenerConfigurer.getSslListener();
       
        assertTrue("Keystore not set properly",
                   sslListener.getKeystore().contains("resources/defaultkeystore"));
        String trustStr = System.getProperty("javax.net.ssl.trustStore");
        assertTrue("Trust store loaded success message not present",
                   trustStr.contains("resources/defaulttruststore"));
        assertTrue("Keystore type not being read",
                   sslListener.getKeystoreType().equals("PKCS12"));
        assertTrue("Couldn't deal with case when SSLServerPolicy keystore password  is null",
                   sslServerPolicy.getKeystorePassword() == null);
        assertTrue("Couldn't deal with case when SSLServerPolicy key password  is null",
                   sslServerPolicy.getKeyPassword() == null)
       
        assertTrue("Ciphersuites is being being read from somewhere unknown",
                   sslListener.getCipherSuites() == null);
        assertTrue("Truststore type not being read",
                   handler.checkLogContainsString("Unsupported SSLServerPolicy property : "
                                                  + "TrustStoreType"));         

        assertTrue("Secure socket protocol not being read",
View Full Code Here

                                             TestHandler handler) {
        try {
            Configuration configuration = EasyMock.createMock(Configuration.class);
           
           
            SslListener sslListener = new SslListener();
            JettySslListenerConfigurer jettySslListenerConfigurer =
                new JettySslListenerConfigurer(configuration,
                                               sslServerPolicy,
                                               sslListener);
           
View Full Code Here

    private final ServerInfo serverInfo;
    private String keystore;
    private String algorithm;

    public HTTPSConnector(JettyContainer container, ServerInfo serverInfo) {
        super(container, new SslListener());
        this.serverInfo = serverInfo;
        https = (SslListener) listener;
    }
View Full Code Here

  public void addSslListener(InetSocketAddress addr, String keystore,
      String storPass, String keyPass) throws IOException {
    if (sslListener != null || webServer.isStarted()) {
      throw new IOException("Failed to add ssl listener");
    }
    sslListener = new SslListener();
    sslListener.setHost(addr.getHostName());
    sslListener.setPort(addr.getPort());
    sslListener.setKeystore(keystore);
    sslListener.setPassword(storPass);
    sslListener.setKeyPassword(keyPass);
View Full Code Here

  public void addSslListener(InetSocketAddress addr, String keystore,
      String storPass, String keyPass) throws IOException {
    if (sslListener != null || webServer.isStarted()) {
      throw new IOException("Failed to add ssl listener");
    }
    sslListener = new SslListener();
    sslListener.setHost(addr.getHostName());
    sslListener.setPort(addr.getPort());
    sslListener.setKeystore(keystore);
    sslListener.setPassword(storPass);
    sslListener.setKeyPassword(keyPass);
View Full Code Here

TOP

Related Classes of org.mortbay.http.SslListener

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.