27.03.2013 Views

JBoss Enterprise Application Platform Common Criteria Certification ...

JBoss Enterprise Application Platform Common Criteria Certification ...

JBoss Enterprise Application Platform Common Criteria Certification ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

32 Chapter 6. The JNDI Naming Service<br />

example shows the section of the http-invoker.sarjboss-service.xml descriptor that the<br />

example installs to provide this configuration. All that has changed relative to the standard HTTP<br />

configuration are the InvokerURLPrefix and InvokerURLSuffix attributes, which setup an HTTPS<br />

URL using the 8443 port.<br />

<br />

<br />

<br />

jboss:service=Naming<br />

<br />

https://<br />

:8443/invoker/JMXInvokerServlet<br />

<br />

true<br />

org.jnp.interfaces.Naming<br />

<br />

<br />

<br />

<br />

org.jboss.proxy.ClientMethodInterceptor<br />

<br />

org.jboss.proxy.SecurityInterceptor<br />

<br />

org.jboss.naming.interceptors.ExceptionInterceptor<br />

<br />

org.jboss.invocation.InvokerInterceptor<br />

<br />

<br />

<br />

<br />

At a minimum, a JNDI client using HTTPS requires setting up a HTTPS URL protocol handler. We will be<br />

using the Java Secure Socket Extension (JSSE) for HTTPS. The JSSE documentation does a good job<br />

of describing what is necessary to use HTTPS, and the following steps were needed to configure the<br />

example client shown in Example 6.2, “A JNDI client that uses HTTPS as the transport”:<br />

A protocol handler for HTTPS URLs must be made available to Java. The JSSE release includes an<br />

HTTPS handler in the com.sun.net.ssl.internal.www.protocol package. To enable the<br />

use of HTTPS URLs you include this package in the standard URL protocol handler search property,<br />

java.protocol.handler.pkgs. We set the java.protocol.handler.pkgs property in the<br />

Ant script.<br />

The JSSE security provider must be installed in order for SSL to work. This can be done either by<br />

installing the JSSE jars as an extension package, or programatically. We use the programatic<br />

approach in the example since this is less intrusive. Line 18 of the ExClient code demonstrates<br />

how this is done.<br />

The JNDI provider URL must use HTTPS as the protocol. Lines 24-25 of the ExClient code specify<br />

an HTTP/SSL connection to the localhost on port 8443. The hostname and port are defined by the<br />

web container SSL connector.<br />

The validation of the HTTPS URL hostname against the server certificate must be disabled. By<br />

default, the JSSE HTTPS protocol handler employs a strict validation of the hostname portion of the<br />

HTTPS URL against the common name of the server certificate. This is the same check done by web<br />

browsers when you connect to secured web site. We are using a self-signed server certificate that<br />

uses a common name of "Chapter 8 SSL Example" rather than a particular hostname, and this<br />

is likely to be common in development environments or intranets. The <strong>JBoss</strong> HttpInvokerProxy<br />

will override the default hostname checking if a org.jboss.security.ignoreHttpsHost system<br />

property exists and has a value of true. We set the org.jboss.security.ignoreHttpsHost<br />

property to true in the Ant script.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!