at.spardat.xma.boot.transport
Class HostnameVerifierImpl

java.lang.Object
  extended byat.spardat.xma.boot.transport.HostnameVerifierImpl
All Implemented Interfaces:
javax.net.ssl.HostnameVerifier

public class HostnameVerifierImpl
extends java.lang.Object
implements javax.net.ssl.HostnameVerifier

This class checks if the common name contained in a server certificate is appropriate for the desired https server. It can be attached to an HttpsUrlConnection by calling HttpsURLConnection.setHostnameVerifier(javax.net.ssl.HostnameVerifier) Then it will be called by the JDK1.4 JSSE HTTPS implementation if the name contained in the certificate does not exactly match the hostname part of the url.

Since:
1.3.0

Constructor Summary
HostnameVerifierImpl(java.util.Properties props)
          Constructs the hostname verifier.
 
Method Summary
 boolean verify(java.lang.String hostname, javax.net.ssl.SSLSession session)
          Checks if the given hostname accepted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HostnameVerifierImpl

public HostnameVerifierImpl(java.util.Properties props)
Constructs the hostname verifier. The property "boot.transport.hostnameverify.ignore" contains the list of hosts for which every certificate name is accepted. This list is seperated by '|' or ';' and every entry may contain one wildcard character ('*').

Parameters:
props - the Properties object containting the mentioned property.
Method Detail

verify

public boolean verify(java.lang.String hostname,
                      javax.net.ssl.SSLSession session)
Checks if the given hostname accepted. If it is contained in the list given in the property "boot.transport.hostnameverify.ignore" it is accepted. This method is called by JDK1.4 JSSE HTTPS implementation only if the name contained in the certificate does not exactly match the hostname part of the url.

Specified by:
verify in interface javax.net.ssl.HostnameVerifier
Parameters:
hostname - DNS-name or IP-address of the SSL-server
session - ignored
Returns:
true if accepted false otherwise