com.canoo.webtest.security
Class SunJsseBaseConnectionInitializer

java.lang.Object
  extended by com.canoo.webtest.security.SecurityConstants
      extended by com.canoo.webtest.security.AbstractConnectionInitializer
          extended by com.canoo.webtest.security.SunJsseBaseConnectionInitializer
All Implemented Interfaces:
IConnectionInitializer
Direct Known Subclasses:
SunJsseClientAuthConnectionInitializer

public class SunJsseBaseConnectionInitializer
extends AbstractConnectionInitializer

Initializer for using https with basic authentication, i\.e\.\ no keystore processing is used. Uses the sun truststore for server certificate checking. Hostname verification accepts all hostnames. (you may want to override this)

See also JSSE Reference

Author:
Carsten Seibert, Dierk Koenig

Field Summary
 
Fields inherited from class com.canoo.webtest.security.AbstractConnectionInitializer
PROTOCOL_HANDLER_KEY, SUN_JSSE_PROVIDER_CLASS, SUN_SSL_PROTOCOL_HANDLER_PACKAGE, TRUST_STORE_KEY, TRUST_STORE_PASSWORD_KEY
 
Fields inherited from class com.canoo.webtest.security.SecurityConstants
PROPERTY_KEYSTORE_ALIAS, PROPERTY_KEYSTORE_FILE, PROPERTY_KEYSTORE_PASSPHRASE, PROPERTY_TRUSTSTORE_FILE, PROPERTY_TRUSTSTORE_PASSPHRASE
 
Constructor Summary
SunJsseBaseConnectionInitializer()
           
 
Method Summary
 void initializeConnection(Configuration config)
          Doing the initialization for https heavily relies on side effects in shared data, i.e.
protected  void installHostnameVerifier(Configuration config)
          Install a customized HostnameVerifier in order to handle mismatches between common name used in the certificate and the actual hostname specified in the URL.
protected  void installTrustAndKeyManager(Configuration config)
           
protected  void logProtocolConfiguration(Configuration config)
           
 
Methods inherited from class com.canoo.webtest.security.AbstractConnectionInitializer
getExternalProperty, hasProvider, installJsseProviderIfRequired, isProtocolHttps, logProperty, setSystemProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SunJsseBaseConnectionInitializer

public SunJsseBaseConnectionInitializer()
Method Detail

initializeConnection

public void initializeConnection(Configuration config)
                          throws ConnectionInitializationException
Doing the initialization for https heavily relies on side effects in shared data, i.e. System properties and static fields in java.security.* and java.net.* .

Throws:
ConnectionInitializationException

installHostnameVerifier

protected void installHostnameVerifier(Configuration config)
Install a customized HostnameVerifier in order to handle mismatches between common name used in the certificate and the actual hostname specified in the URL. Only required if protocol is HTTPS.

Parameters:
config - The current test context.

installTrustAndKeyManager

protected void installTrustAndKeyManager(Configuration config)
                                  throws ConnectionInitializationException
Throws:
ConnectionInitializationException

logProtocolConfiguration

protected void logProtocolConfiguration(Configuration config)

Copyright © 2001-2007 Canoo Engineering AG, Basel. All rights reserved.