Package org.tamacat.httpd.ssl

Source Code of org.tamacat.httpd.ssl.SSLContextCreatorTest

/*
* Copyright (c) 2009, TamaCat.org
* All rights reserved.
*/
package org.tamacat.httpd.ssl;

import static org.junit.Assert.*;


import java.util.Properties;
import javax.net.ssl.SSLContext;

import org.junit.Test;
import org.tamacat.httpd.config.ServerConfig;

public class SSLContextCreatorTest {
 
  @Test
  public void testSSLContextCreatorServerConfig() throws Exception {
    ServerConfig config = new ServerConfig(new Properties());
    config.setParam("https.keyStoreFile", "test.keystore");
    config.setParam("https.keyPassword", "nopassword");
    config.setParam("https.keyStoreType", "JKS");
    config.setParam("https.protocol", "SSLv3");
   
    SSLContextCreator creator = new SSLContextCreator(config);
    SSLContext ctx = creator.getSSLContext();
    assertNotNull(ctx);
  }

  @Test
  public void testGetSSLContext() throws Exception {
    SSLContextCreator creator = new SSLContextCreator();
    creator.setKeyStoreFile("test.keystore");
    creator.setKeyPassword("nopassword");
    creator.setKeyStoreType("JKS");
    creator.setSSLProtocol("SSLv3");
   
    SSLContext ctx = creator.getSSLContext();
    assertNotNull(ctx);
  }
}
TOP

Related Classes of org.tamacat.httpd.ssl.SSLContextCreatorTest

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.