org.openliberty.wsc
Class SSLUtilities

java.lang.Object
  extended by org.openliberty.wsc.SSLUtilities

public class SSLUtilities
extends java.lang.Object

This class contains a group of utilities used by the ClientLib to make SSl/TLS and Mutual SSL/TLS requests.

Author:
tguion, asa

Field Summary
static javax.net.ssl.HostnameVerifier hnv
          Deprecated. 
private static org.apache.log4j.Logger log
           
private static java.lang.String SSL_RSA_WITH_RC4_128_MD5
          This is a widely supported cypher that is not included by the SSLClient default.
static javax.net.ssl.X509TrustManager xtm
          Deprecated. 
 
Constructor Summary
SSLUtilities()
           
 
Method Summary
private static java.net.HttpURLConnection createConnection(java.lang.String urlString)
          Deprecated. 
static void initializeSSLProtocol()
          Deprecated. 
static java.security.cert.X509Certificate loadX509Certificate(java.lang.String pathToX509Certificate)
          Load an X509Certificate from a file, placing it in the OpenLibertyBoostrap Trusted Certificates.
static java.lang.String postSOAPFileViaHttpURLConnection(java.lang.String urlString, java.lang.String inputFileName)
          Deprecated. 
static java.lang.String postSOAPMessage(java.lang.String postUrlString, org.w3c.dom.Element message, boolean isClientTLS)
          This is the method that WSFMessage uses to POST ID-* messages.
static java.lang.String postSOAPMessageViaHttpURLConnection(java.lang.String urlString, org.w3c.dom.Element message)
          Deprecated. 
static java.lang.String postSOAPMessageViaHttpURLConnection(java.lang.String urlString, java.lang.String message)
          Deprecated. 
static java.io.InputStream postSOAPMessageViaHttpURLConnectionIS(java.lang.String urlString, java.lang.String message)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.log4j.Logger log

SSL_RSA_WITH_RC4_128_MD5

private static final java.lang.String SSL_RSA_WITH_RC4_128_MD5
This is a widely supported cypher that is not included by the SSLClient default. We add it manually.

See Also:
Constant Field Values

xtm

@Deprecated
public static javax.net.ssl.X509TrustManager xtm
Deprecated. 
Create an anonymous class to trust all certificates. This is bad style, you should create a separate class.


hnv

@Deprecated
public static javax.net.ssl.HostnameVerifier hnv
Deprecated. 
Create a class to trust all hosts

Constructor Detail

SSLUtilities

public SSLUtilities()
Method Detail

loadX509Certificate

public static java.security.cert.X509Certificate loadX509Certificate(java.lang.String pathToX509Certificate)
Load an X509Certificate from a file, placing it in the OpenLibertyBoostrap Trusted Certificates.

Parameters:
pathToX509Certificate -
Returns:

postSOAPMessage

public static java.lang.String postSOAPMessage(java.lang.String postUrlString,
                                               org.w3c.dom.Element message,
                                               boolean isClientTLS)
                                        throws java.security.GeneralSecurityException,
                                               java.io.IOException
This is the method that WSFMessage uses to POST ID-* messages.

At the suggestion of the OpenSAML java developers, we are using SSLClient from the not-yet-commons-ssl library ( http://juliusdavies.ca/commons-ssl/ ). It simplifies the loading of certificates, SSL, and ClientTLS greatly, and has been said to be more stable than HttpURLConnection.

Parameters:
postUrlString - is the complete URL to the service being invoked. e.g. https://mysvc.com:4343/INVOKE-DISCO
message - the ID-* message as a DOM element
isClientTLS - indicates whether mutual TLS should be used for this transaction
Returns:
the response from the server as a string.
Throws:
java.security.GeneralSecurityException
java.io.IOException

initializeSSLProtocol

@Deprecated
public static void initializeSSLProtocol()
Deprecated. 

Relax the SSL protocol in order to allow out-of-date certificates.


postSOAPMessageViaHttpURLConnection

@Deprecated
public static java.lang.String postSOAPMessageViaHttpURLConnection(java.lang.String urlString,
                                                                              org.w3c.dom.Element message)
                                                            throws java.io.IOException
Deprecated. 

Uility that takes a Document and posts it via HTTP

Parameters:
urlString -
message -
Returns:
Throws:
java.io.IOException

postSOAPFileViaHttpURLConnection

@Deprecated
public static java.lang.String postSOAPFileViaHttpURLConnection(java.lang.String urlString,
                                                                           java.lang.String inputFileName)
                                                         throws java.io.IOException
Deprecated. 

Parameters:
urlString -
inputFileName -
Returns:
Throws:
java.io.IOException

postSOAPMessageViaHttpURLConnection

@Deprecated
public static java.lang.String postSOAPMessageViaHttpURLConnection(java.lang.String urlString,
                                                                              java.lang.String message)
                                                            throws java.io.IOException
Deprecated. 

Parameters:
urlString -
message -
Returns:
Throws:
java.io.IOException

postSOAPMessageViaHttpURLConnectionIS

@Deprecated
public static java.io.InputStream postSOAPMessageViaHttpURLConnectionIS(java.lang.String urlString,
                                                                                   java.lang.String message)
                                                                 throws java.io.IOException
Deprecated. 

Parameters:
urlString -
message -
Returns:
Throws:
java.io.IOException

createConnection

@Deprecated
private static java.net.HttpURLConnection createConnection(java.lang.String urlString)
                                                    throws java.io.IOException
Deprecated. 

Parameters:
urlString -
Returns:
Throws:
java.io.IOException