Tag: SSL

Configuring Https Connector using CLI on JBossAS 7.1.2 & Testing with Java TestClient

Hi,

In this demonstration we will see how to configure Https connector using CLI commands on JBossAS 7.1.2 sothat we can access server deployed resources over SSL on secure port 8443. We will also see how to access the resources over HTTPS through a simple standalone java based client program.

NOTE: This demo can be downloaded from Github:
https://github.com/jaysensharma/MiddlewareMagicDemos/tree/master/SSL_With_CLI_&_JavaBased_TestClient

Step1). First if all we will create Security certificates with the help of JDK provided utility “keytool”, So make sure that the JDK’s bin directory is added in your shell/command prompts PATH variable like following (We are creating the “chap8.keystore” inside “$JBOSS_HOME/standalone/configuration” directory):

.
[userone@localhost ~]$ cd /home/userone/jboss-as-7.1.2.Final/standalone/configuration/

[userone@localhost configuration]$ export PATH=/home/userone/MyJdks/jdk1.6.0_21/bin:$PATH

[userone@localhost configuration] keytool -genkey -keystore chap8.keystore -storepass rmi+ssl -keypass rmi+ssl -keyalg RSA -alias chapter8 -validity 3650 -dname "cn=chapter8 example,ou=admin book,dc=jboss,dc=org"
.

Step2). Make sure that the JBoss AS7.1.2 is running, In our case we started JBossAS7.1.2 “standalone-full.xml” profile.

.
[userone@localhost bin]$ ./standalone.sh -c standalone-full.xml
.

Step3). Now We will configure the Https connector to listen on Secured port “8443” on our JBoss, we will take help of the CLI utility in order to configure the same:

[userone@localhost bin]$ cd /home/userone/jboss-as-7.1.2.Final/bin

[userone@localhost bin]$ ./jboss-cli.sh -c --controller=localhost:9999

[standalone@localhost:9999 /] /subsystem=web/connector=https/:add(socket-binding=https,scheme=https,protocol=HTTP/1.1,secure=true,enabled=true,enable-lookups=false)
{"outcome" => "success"}


[standalone@localhost:9999 /] /subsystem=web/connector=https/ssl=configuration:add(name="ssl",key-alias="chapter8",password="rmi+ssl",certificate-key-file="${jboss.server.config.dir}/chap8.keystore",protocol="TLSv1",verify-client="false",certificate-file="${jboss.server.config.dir}/chap8.keystore")
{"outcome" => "success"}

Once your above CLI command is executed successfully you will notice the following in your JBossAS 7.1.2 configuration file “standalone-full.xml”:

        <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
            <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
            <connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">
                <ssl name="ssl" 
                     key-alias="chapter8" 
                     password="rmi+ssl" 
                     certificate-key-file="${jboss.server.config.dir}/chap8.keystore" 
                     protocol="TLSv1" 
                     verify-client="false" 
                     certificate-file="${jboss.server.config.dir}/chap8.keystore"/>
            </connector>
            <virtual-server name="default-host" enable-welcome-root="true">
                <alias name="localhost"/>
                <alias name="example.com"/>
            </virtual-server>
        </subsystem>

You will notice the following kind of message in your JBossAS7.1.2 console which says that HTTPS connector is started and listening on 8443 port.

.
20:37:05,691 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-7) Starting Coyote HTTP/1.1 on http-localhost/127.0.0.1:8443
.

Step4). Still it is better to restart your JBoss Server and then deploy any Test Web Application on it which we will try to access over SSL through a simple JAVA based standalone client.

Testing with a Https Based Standalone Java Client

Step5). Now write a simple Java program “TestHttpsClient.java” as following:

import java.io.*;
import java.net.*;
import java.security.cert.X509Certificate;
import javax.net.ssl.*;

public class TestHttpsClient implements javax.net.ssl.X509TrustManager {

	public static void main(String[] args) throws Exception {
		TestHttpsClient test=new TestHttpsClient();
		String resourceURL="https://localhost:8443/test/index.jsp";
		String UserName = "test";  // this is just dummy credentials we dont need it until WebApplication asks for Basic Auth Credentials
		String Password = "test";
		InputStream InputStream=test.doHttpsUrlConnectionAction(resourceURL, UserName, Password);
	}


	public InputStream doHttpsUrlConnectionAction(String resourceURL,String UserName,String Password) throws Exception {
		URL url;
		int responseCode = 0;
		// ###########
		SSLContext sc = SSLContext.getInstance("SSLv3");
		TrustManager[] tma = { new TestHttpsClient() };
		sc.init(null, tma, null);
		SSLSocketFactory ssf = sc.getSocketFactory();
		HttpsURLConnection.setDefaultSSLSocketFactory(ssf);
		// ###########
		HttpsURLConnection connection = null;

		String nurl = resourceURL;
		System.out.println("nt resourceURL = " + resourceURL);
		HostnameVerifier hv = new HostnameVerifier() {
			                  public boolean verify(String urlHostName, SSLSession session) {
				                                System.out.println("Warning: URL Host: " + urlHostName+ " vs. " + session.getPeerHost());
				                                return true;
			                                        }
		                                             };

		HttpsURLConnection.setDefaultHostnameVerifier(hv);
		try {
			url = new URL(nurl);
			connection = (HttpsURLConnection) url.openConnection();

                        //  Following two lines can be uncommented if you want your client to pass Basic Authentication Credentials as well
                        //
			//  String encoding = encodeUsernamePasswordBase64(UserName,Password);
			//  connection.setRequestProperty("Authorization", "Basic " + encoding);
                        //

			System.out.println("Conn established " + connection);
			connection.setDoInput(true);
			connection.setDoOutput(true);
			connection.setRequestMethod("GET");
			responseCode = connection.getResponseCode();
			System.out.println("response code : " + responseCode);
			connection.connect();
		} catch (Exception e) {
			System.err.println(e);
		}

		InputStream inputStream = null;
		try {
			inputStream = connection.getInputStream();
			System.out.println("Received Data: as Following:nn");
                        StringBuilder sb=new StringBuilder();
                        BufferedInputStream bis = new BufferedInputStream(inputStream);
                        while (bis.available() > 0) 
                          {
                             System.out.print((char)bis.read());
                          }
                        bis.close();
                        inputStream.close();

		} catch (Exception e) {
			System.err.println(e);
		}
		return inputStream;
	}

	public void checkClientTrusted(X509Certificate[] chain, String authType) {
	}

	public void checkServerTrusted(X509Certificate[] chain, String authType) {
	}

	public X509Certificate[] getAcceptedIssuers() {
		return null;
	}


        //      Following method can be uncommented if you want to sent the Basic authentication credential as well 

	//public String encodeUsernamePasswordBase64(String UserName,String Password) {
	//	String userPassword = UserName + ":" + Password;
	//	byte[] encodedByte = org.apache.commons.codec.binary.Base64.encodeBase64(userPassword.getBytes());
	//	String encodedBase64String = new String(encodedByte);
	//	return encodedBase64String;
	//}
 }

Step6). Now we will compile and test the above program as following:

[userone@localhost standalone]$ javac -d . TestHttpsClient.java 
[userone@localhost standalone]$ java TestHttpsClient 

	 resourceURL = https://localhost:8443/test/index.jsp
Conn established sun.net.www.protocol.https.DelegateHttpsURLConnection:https://localhost:8443/test/index.jsp
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
[userone@localhost standalone]$

We can see that the program is throwing SSL Error and the Handshake is failing. So we need to know how to debug it and what kind of trouble shooting steps are needed.

Troubleshooting “Received fatal alert: handshake_failure”

Step7). As we do not know what is failing and how to troubleshoot this issue so lets add the following JAVA_OPTS on both client and server side. Edit the “$JBOSS_HOME/bin/standalone.conf” file and then add the following java option somewhere at the end of the file then restart your JBossAS 7.1.2:

JAVA_OPTS="$JAVA_OPTS  -Djavax.net.debug=all"

Step8). Now add the same JAVA_OPTION on the client side as well to see what we get:


[userone@localhost standalone]$ java -Djavax.net.debug=all TestHttpsClient 
.
.
trigger seeding of SecureRandom
done seeding SecureRandom

	 resourceURL = https://localhost:8443/test/index.jsp
Conn established sun.net.www.protocol.https.DelegateHttpsURLConnection:https://localhost:8443/test/index.jsp
%% No cached client session
*** ClientHello, TLSv1
RandomCookie:  GMT: 1345238221 bytes = { 105, 167, 167, 204, 97, 58, 22, 192, 82, 217, 200, 202, 181, 7, 25, 79, 228, 159, 44, 247, 106, 185, 240, 130, 26, 152, 20, 178 }
Session ID:  {}
Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
Compression Methods:  { 0 }
***
[write] MD5 and SHA1 hashes:  len = 73
0000: 01 00 00 45 03 01 50 2F   B5 CD 69 A7 A7 CC 61 3A  ...E..P/..i...a:
0010: 16 C0 52 D9 C8 CA B5 07   19 4F E4 9F 2C F7 6A B9  ..R......O..,.j.
0020: F0 82 1A 98 14 B2 00 00   1E 00 04 00 05 00 2F 00  ............../.
0030: 33 00 32 00 0A 00 16 00   13 00 09 00 15 00 12 00  3.2.............
0040: 03 00 08 00 14 00 11 01   00                       .........
main, WRITE: TLSv1 Handshake, length = 73
[write] MD5 and SHA1 hashes:  len = 98
0000: 01 03 01 00 39 00 00 00   20 00 00 04 01 00 80 00  ....9... .......
0010: 00 05 00 00 2F 00 00 33   00 00 32 00 00 0A 07 00  ..../..3..2.....
0020: C0 00 00 16 00 00 13 00   00 09 06 00 40 00 00 15  ............@...
0030: 00 00 12 00 00 03 02 00   80 00 00 08 00 00 14 00  ................
0040: 00 11 50 2F B5 CD 69 A7   A7 CC 61 3A 16 C0 52 D9  ..P/..i...a:..R.
0050: C8 CA B5 07 19 4F E4 9F   2C F7 6A B9 F0 82 1A 98  .....O..,.j.....
0060: 14 B2                                              ..
main, WRITE: SSLv2 client hello message, length = 98
[Raw write]: length = 100
0000: 80 62 01 03 01 00 39 00   00 00 20 00 00 04 01 00  .b....9... .....
0010: 80 00 00 05 00 00 2F 00   00 33 00 00 32 00 00 0A  ....../..3..2...
0020: 07 00 C0 00 00 16 00 00   13 00 00 09 06 00 40 00  ..............@.
0030: 00 15 00 00 12 00 00 03   02 00 80 00 00 08 00 00  ................
0040: 14 00 00 11 50 2F B5 CD   69 A7 A7 CC 61 3A 16 C0  ....P/..i...a:..
0050: 52 D9 C8 CA B5 07 19 4F   E4 9F 2C F7 6A B9 F0 82  R......O..,.j...
0060: 1A 98 14 B2                                        ....
[Raw read]: length = 5
0000: 15 03 01 00 02                                     .....
[Raw read]: length = 2
0000: 02 28                                              .(
main, READ: TLSv1 Alert, length = 2
main, RECV TLSv1 ALERT:  fatal, handshake_failure
main, called closeSocket()
main, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Step9). On the JBossAS7.1.2 console i was able to see the following kind of reason for the SSL Handshake after enabling the debug:

21:03:33,010 INFO  [stdout] (http-localhost/127.0.0.1:8443-Acceptor-0) Allow unsafe renegotiation: false
21:03:33,010 INFO  [stdout] (http-localhost/127.0.0.1:8443-Acceptor-0) Allow legacy hello messages: true
21:03:33,010 INFO  [stdout] (http-localhost/127.0.0.1:8443-Acceptor-0) Is initial handshake: true
21:03:33,010 INFO  [stdout] (http-localhost/127.0.0.1:8443-Acceptor-0) Is secure renegotiation: false
21:03:33,012 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) http-localhost/127.0.0.1:8443-1, setSoTimeout(60000) called
21:03:33,069 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) [Raw read]: length = 5
21:03:33,070 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) 0000: 80 62 01 03 01                                     .b...
21:03:33,070 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) http-localhost/127.0.0.1:8443-1, handling exception: javax.net.ssl.SSLHandshakeException: SSLv2Hello is disabled
21:03:33,071 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) http-localhost/127.0.0.1:8443-1, SEND TLSv1 ALERT:  fatal, description = handshake_failure
21:03:33,071 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) http-localhost/127.0.0.1:8443-1, WRITE: TLSv1 Alert, length = 2
21:03:33,072 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) [Raw write]: length = 7
21:03:33,072 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) 0000: 15 03 01 00 02 02 28                               ......(
21:03:33,072 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) http-localhost/127.0.0.1:8443-1, called closeSocket()
21:03:33,073 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) http-localhost/127.0.0.1:8443-1, IOException in getSession():  javax.net.ssl.SSLHandshakeException: SSLv2Hello is disabled
21:03:33,073 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) http-localhost/127.0.0.1:8443-1, called close()
21:03:33,073 INFO  [stdout] (http-localhost/127.0.0.1:8443-1) http-localhost/127.0.0.1:8443-1, called closeInternal(true)
.

What was the Cause of handshake failure ?

Notice JBossAS 7.1.2 is cmplaining that “SSLv2Hello” is disabled which means the client is not sending a proper SSL Protocol.

http-localhost/127.0.0.1:8443-1, handling exception: javax.net.ssl.SSLHandshakeException: SSLv2Hello is disabled

Step10). So now as we know that the client is not using a proper protocol to send the request so we will try adding the following JAVA_OPTS [ -Dhttps.protocols=TLSv1 ] on the client side in order to use the TLSv1 protocol for communication:

[userone@localhost standalone]$ java -Djavax.net.debug=all  -Dhttps.protocols=TLSv1 TestHttpsClient 
.
.
trigger seeding of SecureRandom
done seeding SecureRandom

	 resourceURL = https://localhost:8443/test/index.jsp
Conn established sun.net.www.protocol.https.DelegateHttpsURLConnection:https://localhost:8443/test/index.jsp
%% No cached client session
*** ClientHello, TLSv1
RandomCookie:  GMT: 1345238823 bytes = { 59, 48, 212, 175, 197, 249, 200, 221, 96, 72, 203, 206, 27, 95, 71, 211, 123, 182, 131, 91, 91, 236, 19, 6, 159, 175, 93, 210 }
Session ID:  {}
Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
Compression Methods:  { 0 }
***
[write] MD5 and SHA1 hashes:  len = 73
0000: 01 00 00 45 03 01 50 2F   B7 27 3B 30 D4 AF C5 F9  ...E..P/.';0....
0010: C8 DD 60 48 CB CE 1B 5F   47 D3 7B B6 83 5B 5B EC  ..`H..._G....[[.
0020: 13 06 9F AF 5D D2 00 00   1E 00 04 00 05 00 2F 00  ....]........./.
0030: 33 00 32 00 0A 00 16 00   13 00 09 00 15 00 12 00  3.2.............
0040: 03 00 08 00 14 00 11 01   00                       .........
main, WRITE: TLSv1 Handshake, length = 73
[Raw write]: length = 78
0000: 16 03 01 00 49 01 00 00   45 03 01 50 2F B7 27 3B  ....I...E..P/.';
0010: 30 D4 AF C5 F9 C8 DD 60   48 CB CE 1B 5F 47 D3 7B  0......`H..._G..
0020: B6 83 5B 5B EC 13 06 9F   AF 5D D2 00 00 1E 00 04  ..[[.....]......
0030: 00 05 00 2F 00 33 00 32   00 0A 00 16 00 13 00 09  .../.3.2........
0040: 00 15 00 12 00 03 00 08   00 14 00 11 01 00        ..............
[Raw read]: length = 5
0000: 16 03 01 02 8B                                     .....
[Raw read]: length = 651
0000: 02 00 00 46 03 01 50 2F   B7 27 A2 82 8C F5 F3 F7  ...F..P/.'......
0010: 5F EE 55 CA 25 5E 83 5A   1D C8 39 2E 07 8C FE E0  _.U.%^.Z..9.....
0020: 67 8C 41 0C F4 01 20 50   2F B7 27 01 EA 77 CD 5D  g.A... P/.'..w.]
0030: 66 82 11 AC 11 96 9B 6E   8B AD 8D 8E 59 81 C9 D4  f......n....Y...
0040: 62 A0 CD 96 1F 96 0F 00   04 00 0B 00 02 39 00 02  b............9..
0050: 36 00 02 33 30 82 02 2F   30 82 01 98 A0 03 02 01  6..30../0.......
0060: 02 02 04 50 2F AE 0A 30   0D 06 09 2A 86 48 86 F7  ...P/..0...*.H..
0070: 0D 01 01 05 05 00 30 5C   31 13 30 11 06 0A 09 92  ......01.0.....
0080: 26 89 93 F2 2C 64 01 19   16 03 6F 72 67 31 15 30  &...,d....org1.0
0090: 13 06 0A 09 92 26 89 93   F2 2C 64 01 19 16 05 6A  .....&...,d....j
00A0: 62 6F 73 73 31 13 30 11   06 03 55 04 0B 13 0A 61  boss1.0...U....a
00B0: 64 6D 69 6E 20 62 6F 6F   6B 31 19 30 17 06 03 55  dmin book1.0...U
00C0: 04 03 13 10 63 68 61 70   74 65 72 38 20 65 78 61  ....chapter8 exa
00D0: 6D 70 6C 65 30 1E 17 0D   31 32 30 38 31 38 31 35  mple0...12081815
00E0: 30 30 32 36 5A 17 0D 32   32 30 38 31 36 31 35 30  0026Z..220816150
00F0: 30 32 36 5A 30 5C 31 13   30 11 06 0A 09 92 26 89  026Z01.0.....&.
0100: 93 F2 2C 64 01 19 16 03   6F 72 67 31 15 30 13 06  ..,d....org1.0..
0110: 0A 09 92 26 89 93 F2 2C   64 01 19 16 05 6A 62 6F  ...&...,d....jbo
0120: 73 73 31 13 30 11 06 03   55 04 0B 13 0A 61 64 6D  ss1.0...U....adm
0130: 69 6E 20 62 6F 6F 6B 31   19 30 17 06 03 55 04 03  in book1.0...U..
0140: 13 10 63 68 61 70 74 65   72 38 20 65 78 61 6D 70  ..chapter8 examp
0150: 6C 65 30 81 9F 30 0D 06   09 2A 86 48 86 F7 0D 01  le0..0...*.H....
0160: 01 01 05 00 03 81 8D 00   30 81 89 02 81 81 00 9F  ........0.......
0170: F5 D8 05 FD 40 7F E8 BB   92 10 39 EB 19 C9 E5 58  ....@.....9....X
0180: 4E 11 18 32 75 8A 49 53   4A 18 BF 3E C1 09 5C F1  N..2u.ISJ..>...
0190: 1D C2 96 8C 86 29 A2 1D   8F 51 2E B8 15 7F 6E C0  .....)...Q....n.
01A0: 20 8A 50 47 C8 A1 4A C7   77 CD CC EB 9C 11 24 E2   .PG..J.w.....$.
01B0: EE E6 98 9A 38 C9 9E FF   AF AC E7 8C D4 29 17 4E  ....8........).N
01C0: 8A 7E 89 C8 52 27 A0 D1   9F DF 7D D0 D9 7B EB 22  ....R'........."
01D0: 9E 80 6F 11 DD 5B 60 9C   74 DB A5 77 F4 B6 F2 46  ..o..[`.t..w...F
01E0: DC D1 18 A4 E9 16 73 43   F6 ED 11 5B 1C 25 5B 02  ......sC...[.%[.
01F0: 03 01 00 01 30 0D 06 09   2A 86 48 86 F7 0D 01 01  ....0...*.H.....
0200: 05 05 00 03 81 81 00 09   0F C7 47 4C 20 61 FF 59  ..........GL a.Y
0210: 2F 8C 3E 46 B1 32 CE 09   36 F3 25 AF 2C 37 D5 DA  /.>F.2..6.%.,7..
0220: 54 78 D3 4B EA 78 78 F4   B4 C1 DC BF 4E 11 CE 03  Tx.K.xx.....N...
0230: 6D 57 F5 07 2F CA 02 B6   23 B3 40 26 F4 3C 9E 09  mW../...#.@&.<..
0240: 75 16 F9 94 AF B4 EF C4   C1 0E A7 F9 5F 2F 70 18  u..........._/p.
0250: C0 B5 09 16 E2 A6 BC 86   EF 7F A4 E1 F5 C2 35 C6  ..............5.
0260: F4 09 BB 93 A8 23 91 E4   F1 42 59 53 89 47 F1 04  .....#...BYS.G..
0270: B5 CE 30 C0 BE 7A 9E D0   D2 57 B5 61 B0 F1 1A D2  ..0..z...W.a....
0280: C6 C5 4E 10 4C FC 6F 0E   00 00 00                 ..N.L.o....
main, READ: TLSv1 Handshake, length = 651
*** ServerHello, TLSv1
RandomCookie:  GMT: 1345238823 bytes = { 162, 130, 140, 245, 243, 247, 95, 238, 85, 202, 37, 94, 131, 90, 29, 200, 57, 46, 7, 140, 254, 224, 103, 140, 65, 12, 244, 1 }
Session ID:  {80, 47, 183, 39, 1, 234, 119, 205, 93, 102, 130, 17, 172, 17, 150, 155, 110, 139, 173, 141, 142, 89, 129, 201, 212, 98, 160, 205, 150, 31, 150, 15}
Cipher Suite: SSL_RSA_WITH_RC4_128_MD5
Compression Method: 0
***
%% Created:  [Session-1, SSL_RSA_WITH_RC4_128_MD5]
** SSL_RSA_WITH_RC4_128_MD5
[read] MD5 and SHA1 hashes:  len = 74
0000: 02 00 00 46 03 01 50 2F   B7 27 A2 82 8C F5 F3 F7  ...F..P/.'......
0010: 5F EE 55 CA 25 5E 83 5A   1D C8 39 2E 07 8C FE E0  _.U.%^.Z..9.....
0020: 67 8C 41 0C F4 01 20 50   2F B7 27 01 EA 77 CD 5D  g.A... P/.'..w.]
0030: 66 82 11 AC 11 96 9B 6E   8B AD 8D 8E 59 81 C9 D4  f......n....Y...
0040: 62 A0 CD 96 1F 96 0F 00   04 00                    b.........
*** Certificate chain
chain [0] = [
[
  Version: V3
  Subject: CN=chapter8 example, OU=admin book, DC=jboss, DC=org
  Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5

  Key:  Sun RSA public key, 1024 bits
  modulus: 112327961955793427294788693539127054708342991554979642795375341813812315606410953443425170876453687812657572324528850546265317609032949186934642585274247999052696216659140187935451881753515565277516661450297298499364056248126550289023310877209666305304254207350144517608476196856386756508895595865011272820059
  public exponent: 65537
  Validity: [From: Sat Aug 18 20:30:26 IST 2012,
               To: Tue Aug 16 20:30:26 IST 2022]
  Issuer: CN=chapter8 example, OU=admin book, DC=jboss, DC=org
  SerialNumber: [    502fae0a]

]
  Algorithm: [SHA1withRSA]
  Signature:
0000: 09 0F C7 47 4C 20 61 FF   59 2F 8C 3E 46 B1 32 CE  ...GL a.Y/.>F.2.
0010: 09 36 F3 25 AF 2C 37 D5   DA 54 78 D3 4B EA 78 78  .6.%.,7..Tx.K.xx
0020: F4 B4 C1 DC BF 4E 11 CE   03 6D 57 F5 07 2F CA 02  .....N...mW../..
0030: B6 23 B3 40 26 F4 3C 9E   09 75 16 F9 94 AF B4 EF  .#.@&.<..u......
0040: C4 C1 0E A7 F9 5F 2F 70   18 C0 B5 09 16 E2 A6 BC  ....._/p........
0050: 86 EF 7F A4 E1 F5 C2 35   C6 F4 09 BB 93 A8 23 91  .......5......#.
0060: E4 F1 42 59 53 89 47 F1   04 B5 CE 30 C0 BE 7A 9E  ..BYS.G....0..z.
0070: D0 D2 57 B5 61 B0 F1 1A   D2 C6 C5 4E 10 4C FC 6F  ..W.a......N.L.o

]
***
[read] MD5 and SHA1 hashes:  len = 573
0000: 0B 00 02 39 00 02 36 00   02 33 30 82 02 2F 30 82  ...9..6..30../0.
0010: 01 98 A0 03 02 01 02 02   04 50 2F AE 0A 30 0D 06  .........P/..0..
0020: 09 2A 86 48 86 F7 0D 01   01 05 05 00 30 5C 31 13  .*.H........01.
0030: 30 11 06 0A 09 92 26 89   93 F2 2C 64 01 19 16 03  0.....&...,d....
0040: 6F 72 67 31 15 30 13 06   0A 09 92 26 89 93 F2 2C  org1.0.....&...,
0050: 64 01 19 16 05 6A 62 6F   73 73 31 13 30 11 06 03  d....jboss1.0...
0060: 55 04 0B 13 0A 61 64 6D   69 6E 20 62 6F 6F 6B 31  U....admin book1
0070: 19 30 17 06 03 55 04 03   13 10 63 68 61 70 74 65  .0...U....chapte
0080: 72 38 20 65 78 61 6D 70   6C 65 30 1E 17 0D 31 32  r8 example0...12
0090: 30 38 31 38 31 35 30 30   32 36 5A 17 0D 32 32 30  0818150026Z..220
00A0: 38 31 36 31 35 30 30 32   36 5A 30 5C 31 13 30 11  816150026Z01.0.
00B0: 06 0A 09 92 26 89 93 F2   2C 64 01 19 16 03 6F 72  ....&...,d....or
00C0: 67 31 15 30 13 06 0A 09   92 26 89 93 F2 2C 64 01  g1.0.....&...,d.
00D0: 19 16 05 6A 62 6F 73 73   31 13 30 11 06 03 55 04  ...jboss1.0...U.
00E0: 0B 13 0A 61 64 6D 69 6E   20 62 6F 6F 6B 31 19 30  ...admin book1.0
00F0: 17 06 03 55 04 03 13 10   63 68 61 70 74 65 72 38  ...U....chapter8
0100: 20 65 78 61 6D 70 6C 65   30 81 9F 30 0D 06 09 2A   example0..0...*
0110: 86 48 86 F7 0D 01 01 01   05 00 03 81 8D 00 30 81  .H............0.
0120: 89 02 81 81 00 9F F5 D8   05 FD 40 7F E8 BB 92 10  ..........@.....
0130: 39 EB 19 C9 E5 58 4E 11   18 32 75 8A 49 53 4A 18  9....XN..2u.ISJ.
0140: BF 3E C1 09 5C F1 1D C2   96 8C 86 29 A2 1D 8F 51  .>........)...Q
0150: 2E B8 15 7F 6E C0 20 8A   50 47 C8 A1 4A C7 77 CD  ....n. .PG..J.w.
0160: CC EB 9C 11 24 E2 EE E6   98 9A 38 C9 9E FF AF AC  ....$.....8.....
0170: E7 8C D4 29 17 4E 8A 7E   89 C8 52 27 A0 D1 9F DF  ...).N....R'....
0180: 7D D0 D9 7B EB 22 9E 80   6F 11 DD 5B 60 9C 74 DB  ....."..o..[`.t.
0190: A5 77 F4 B6 F2 46 DC D1   18 A4 E9 16 73 43 F6 ED  .w...F......sC..
01A0: 11 5B 1C 25 5B 02 03 01   00 01 30 0D 06 09 2A 86  .[.%[.....0...*.
01B0: 48 86 F7 0D 01 01 05 05   00 03 81 81 00 09 0F C7  H...............
01C0: 47 4C 20 61 FF 59 2F 8C   3E 46 B1 32 CE 09 36 F3  GL a.Y/.>F.2..6.
01D0: 25 AF 2C 37 D5 DA 54 78   D3 4B EA 78 78 F4 B4 C1  %.,7..Tx.K.xx...
01E0: DC BF 4E 11 CE 03 6D 57   F5 07 2F CA 02 B6 23 B3  ..N...mW../...#.
01F0: 40 26 F4 3C 9E 09 75 16   F9 94 AF B4 EF C4 C1 0E  @&.<..u.........
0200: A7 F9 5F 2F 70 18 C0 B5   09 16 E2 A6 BC 86 EF 7F  .._/p...........
0210: A4 E1 F5 C2 35 C6 F4 09   BB 93 A8 23 91 E4 F1 42  ....5......#...B
0220: 59 53 89 47 F1 04 B5 CE   30 C0 BE 7A 9E D0 D2 57  YS.G....0..z...W
0230: B5 61 B0 F1 1A D2 C6 C5   4E 10 4C FC 6F           .a......N.L.o
*** ServerHelloDone
[read] MD5 and SHA1 hashes:  len = 4
0000: 0E 00 00 00                                        ....
*** ClientKeyExchange, RSA PreMasterSecret, TLSv1
[write] MD5 and SHA1 hashes:  len = 134
0000: 10 00 00 82 00 80 32 75   DE 6E 2E 5A F9 1C 5E AF  ......2u.n.Z..^.
0010: F9 58 7C 27 5D 83 3A 08   4C 09 1E 31 9C E9 DF F3  .X.'].:.L..1....
0020: E9 C9 7F 78 04 73 FA 43   F1 8F 2C 9F D0 F8 E1 4D  ...x.s.C..,....M
0030: 5E C8 A4 17 EB C9 68 B5   67 DE CD 34 3E 4B 55 E5  ^.....h.g..4>KU.
0040: 38 F3 AD 5A 23 D1 5D 11   89 B5 3C F5 F7 B3 A8 A9  8..Z#.]...<.....
0050: EE 79 BD B5 5D 96 F1 B1   48 4F BF E8 16 81 A1 EB  .y..]...HO......
0060: 65 77 ED 21 9C 29 4A 80   12 86 1D 82 9D A8 1E 63  ew.!.)J........c
0070: 7F 2A AA 40 06 97 70 4D   BF D7 C0 D2 27 87 F0 11  .*.@..pM....'...
0080: 3A C2 99 ED 87 1C                                  :.....
main, WRITE: TLSv1 Handshake, length = 134
[Raw write]: length = 139
0000: 16 03 01 00 86 10 00 00   82 00 80 32 75 DE 6E 2E  ...........2u.n.
0010: 5A F9 1C 5E AF F9 58 7C   27 5D 83 3A 08 4C 09 1E  Z..^..X.'].:.L..
0020: 31 9C E9 DF F3 E9 C9 7F   78 04 73 FA 43 F1 8F 2C  1.......x.s.C..,
0030: 9F D0 F8 E1 4D 5E C8 A4   17 EB C9 68 B5 67 DE CD  ....M^.....h.g..
0040: 34 3E 4B 55 E5 38 F3 AD   5A 23 D1 5D 11 89 B5 3C  4>KU.8..Z#.]...<
0050: F5 F7 B3 A8 A9 EE 79 BD   B5 5D 96 F1 B1 48 4F BF  ......y..]...HO.
0060: E8 16 81 A1 EB 65 77 ED   21 9C 29 4A 80 12 86 1D  .....ew.!.)J....
0070: 82 9D A8 1E 63 7F 2A AA   40 06 97 70 4D BF D7 C0  ....c.*.@..pM...
0080: D2 27 87 F0 11 3A C2 99   ED 87 1C                 .'...:.....
SESSION KEYGEN:
PreMaster Secret:
0000: 03 01 7E AA A8 36 E5 83   D8 6B 8E 5D 58 FD 7F CD  .....6...k.]X...
0010: D0 3F 2E 13 22 AA F0 4B   DB FB 69 DF 49 D6 41 94  .?.."..K..i.I.A.
0020: 25 69 46 F4 41 4E 35 26   5F 24 83 31 A3 81 4B 8D  %iF.AN5&_$.1..K.
CONNECTION KEYGEN:
Client Nonce:
0000: 50 2F B7 27 3B 30 D4 AF   C5 F9 C8 DD 60 48 CB CE  P/.';0......`H..
0010: 1B 5F 47 D3 7B B6 83 5B   5B EC 13 06 9F AF 5D D2  ._G....[[.....].
Server Nonce:
0000: 50 2F B7 27 A2 82 8C F5   F3 F7 5F EE 55 CA 25 5E  P/.'......_.U.%^
0010: 83 5A 1D C8 39 2E 07 8C   FE E0 67 8C 41 0C F4 01  .Z..9.....g.A...
Master Secret:
0000: 53 99 13 E9 DE C8 EB 85   D8 4F E4 52 D9 9E 91 DE  S........O.R....
0010: FD FE F0 2E B5 E2 65 F6   96 A4 48 C1 E0 4D 74 EB  ......e...H..Mt.
0020: 3E AC 50 84 3A C0 5C 08   ED 7F BC 39 DF E5 FA 02  >.P.:.....9....
Client MAC write Secret:
0000: 93 58 54 31 D6 18 0A FE   BC FF 40 86 66 1C 95 A5  .XT1......@.f...
Server MAC write Secret:
0000: F5 F9 2E 64 12 A2 F3 6B   6B 69 C2 AA 36 14 AA 2C  ...d...kki..6..,
Client write key:
0000: 0F AF E3 10 1C 9B 24 A4   C8 0C 01 E1 FC 64 4F 55  ......$......dOU
Server write key:
0000: 72 04 94 3B 1E 2C DA 21   35 D7 ED CA A7 B7 3C 02  r..;.,.!5.....<.
... no IV used for this cipher
main, WRITE: TLSv1 Change Cipher Spec, length = 1
[Raw write]: length = 6
0000: 14 03 01 00 01 01                                  ......
*** Finished
verify_data:  { 199, 153, 29, 209, 100, 86, 200, 134, 249, 145, 192, 14 }
***
[write] MD5 and SHA1 hashes:  len = 16
0000: 14 00 00 0C C7 99 1D D1   64 56 C8 86 F9 91 C0 0E  ........dV......
Padded plaintext before ENCRYPTION:  len = 32
0000: 14 00 00 0C C7 99 1D D1   64 56 C8 86 F9 91 C0 0E  ........dV......
0010: E0 C0 5C E7 78 59 C8 72   7C 8E A5 C8 6B 90 C0 75  ...xY.r....k..u
main, WRITE: TLSv1 Handshake, length = 32
[Raw write]: length = 37
0000: 16 03 01 00 20 1C 00 C9   12 EE AE 76 26 82 5F CC  .... ......v&._.
0010: 65 93 CA 0C 84 70 A0 34   94 46 C9 86 AE AC A2 23  e....p.4.F.....#
0020: A4 6F EF DB 64                                     .o..d
[Raw read]: length = 5
0000: 14 03 01 00 01                                     .....
[Raw read]: length = 1
0000: 01                                                 .
main, READ: TLSv1 Change Cipher Spec, length = 1
[Raw read]: length = 5
0000: 16 03 01 00 20                                     .... 
[Raw read]: length = 32
0000: 38 14 9D A8 51 FA B5 58   CE 7A E2 8A 0F E6 5E 45  8...Q..X.z....^E
0010: D3 4D 65 CF 1C 7B 44 C6   01 BD 69 42 2A 66 DB 8A  .Me...D...iB*f..
main, READ: TLSv1 Handshake, length = 32
Padded plaintext after DECRYPTION:  len = 32
0000: 14 00 00 0C 76 99 74 92   C7 45 2B ED AC 2D 2F 7A  ....v.t..E+..-/z
0010: 24 3E 7A 7A F9 1B 07 9F   1F 99 E6 DC 3C 2C 2B 7E  $>zz........<,+.
*** Finished
verify_data:  { 118, 153, 116, 146, 199, 69, 43, 237, 172, 45, 47, 122 }
***
%% Cached client session: [Session-1, SSL_RSA_WITH_RC4_128_MD5]
[read] MD5 and SHA1 hashes:  len = 16
0000: 14 00 00 0C 76 99 74 92   C7 45 2B ED AC 2D 2F 7A  ....v.t..E+..-/z
Warning: URL Host: localhost vs. localhost
Padded plaintext before ENCRYPTION:  len = 183
0000: 47 45 54 20 2F 74 65 73   74 2F 69 6E 64 65 78 2E  GET /test/index.
0010: 6A 73 70 20 48 54 54 50   2F 31 2E 31 0D 0A 55 73  jsp HTTP/1.1..Us
0020: 65 72 2D 41 67 65 6E 74   3A 20 4A 61 76 61 2F 31  er-Agent: Java/1
0030: 2E 36 2E 30 5F 32 31 0D   0A 48 6F 73 74 3A 20 6C  .6.0_21..Host: l
0040: 6F 63 61 6C 68 6F 73 74   3A 38 34 34 33 0D 0A 41  ocalhost:8443..A
0050: 63 63 65 70 74 3A 20 74   65 78 74 2F 68 74 6D 6C  ccept: text/html
0060: 2C 20 69 6D 61 67 65 2F   67 69 66 2C 20 69 6D 61  , image/gif, ima
0070: 67 65 2F 6A 70 65 67 2C   20 2A 3B 20 71 3D 2E 32  ge/jpeg, *; q=.2
0080: 2C 20 2A 2F 2A 3B 20 71   3D 2E 32 0D 0A 43 6F 6E  , */*; q=.2..Con
0090: 6E 65 63 74 69 6F 6E 3A   20 6B 65 65 70 2D 61 6C  nection: keep-al
00A0: 69 76 65 0D 0A 0D 0A C9   B3 D8 80 FB 69 A2 16 CA  ive.........i...
00B0: 87 1A DD 7B 85 29 77                               .....)w
main, WRITE: TLSv1 Application Data, length = 183
[Raw write]: length = 188
0000: 17 03 01 00 B7 9C 55 72   D7 0D 18 85 09 23 B7 2D  ......Ur.....#.-
0010: E9 8A A7 B7 A2 48 44 B3   7D CB 60 DE 44 7E F8 9C  .....HD...`.D...
0020: FE E8 46 DD 99 25 90 44   B3 8B CE B2 6A 83 38 2E  ..F..%.D....j.8.
0030: F8 F0 DF 4B 4E 08 58 37   D2 39 5F EB 44 B7 38 86  ...KN.X7.9_.D.8.
0040: A2 9A 70 74 33 AA 02 0F   62 05 29 57 7E C5 DF 87  ..pt3...b.)W....
0050: 35 06 EF 5C 4D 96 CF F0   84 73 10 60 BD B0 10 BF  5..M....s.`....
0060: 1C 18 FE 81 AD B8 08 DD   CF 2C 69 42 41 09 11 AD  .........,iBA...
0070: ED 48 45 8D A7 E2 F8 8D   9B 89 BF 9A F4 00 1F BB  .HE.............
0080: 21 02 10 FE B5 4E 55 BD   63 4C 2E 4B E0 8B C9 84  !....NU.cL.K....
0090: C6 E3 18 39 3F A9 F3 87   52 67 F7 6E 44 91 12 98  ...9?...Rg.nD...
00A0: C3 3C 87 AD 82 9C EF F2   8B E2 A6 C2 FA 96 10 08  .<..............
00B0: F0 D9 82 EA F8 9B 26 44   2F 04 09 A5              ......&D/...
[Raw read]: length = 5
0000: 17 03 01 01 20                                     .... 
[Raw read]: length = 288
0000: DF F0 E4 38 81 CE 54 3B   AD 8E 58 08 4D F8 2F 32  ...8..T;..X.M./2
0010: A6 1A 79 EC 5F 5D CC 77   FD 71 65 9B DC C5 A2 40  ..y._].w.qe....@
0020: B0 1A 52 5B BD 46 1F DD   18 85 95 FC F3 82 8E 6A  ..R[.F.........j
0030: D3 DC DB A1 F9 8B A8 C1   62 63 C2 6B BB 95 78 C7  ........bc.k..x.
0040: 89 59 A4 02 D9 C0 35 66   11 7E 6E B8 43 96 7C FD  .Y....5f..n.C...
0050: AE 47 CB 64 52 AB FA DA   40 01 2A 4B AD FD 30 10  .G.dR...@.*K..0.
0060: 40 2A 8D 4B E4 B5 49 E3   CA C5 02 8E 5B C8 66 84  @*.K..I.....[.f.
0070: D2 75 49 48 28 77 90 26   92 E1 48 A9 F1 9A 78 23  .uIH(w.&..H...x#
0080: 90 D1 02 15 89 0F 4D 8A   D7 30 04 17 F5 6E F0 ED  ......M..0...n..
0090: 32 92 1A 9D 5D 27 68 FD   9E BA 52 AD DA 45 2E 66  2...]'h...R..E.f
00A0: 33 A5 D6 B5 05 96 25 6C   F4 C0 20 24 24 A9 A1 87  3.....%l.. $$...
00B0: 02 DE 05 7E DA 9F 7A B3   7F 00 E2 CB 87 1B 6F 09  ......z.......o.
00C0: 1E 3E 6C 90 7C 3E 34 34   F3 FD B5 29 8F 8D 6D 88  .>l..>44...)..m.
00D0: 12 BE 0A B4 B2 5A 12 C4   4F 96 3F 8B 9A 2A 30 46  .....Z..O.?..*0F
00E0: 4C D5 8C C5 03 78 B9 36   AD FA 0A 9E BB 85 35 E0  L....x.6......5.
00F0: E6 AD 70 74 2D E2 F7 BF   7B B8 12 F8 7F 83 E1 92  ..pt-...........
0100: 4F 40 A8 30 BF 4C E6 5D   47 1A 0B 5C 5A 47 A4 6E  O@.0.L.]G..ZG.n
0110: 35 89 0E E7 42 18 AC F5   26 1B DD B1 7A A9 FC 99  5...B...&...z...
main, READ: TLSv1 Application Data, length = 288
Padded plaintext after DECRYPTION:  len = 288
0000: 48 54 54 50 2F 31 2E 31   20 32 30 30 20 4F 4B 0D  HTTP/1.1 200 OK.
0010: 0A 53 65 72 76 65 72 3A   20 41 70 61 63 68 65 2D  .Server: Apache-
0020: 43 6F 79 6F 74 65 2F 31   2E 31 0D 0A 58 2D 50 6F  Coyote/1.1..X-Po
0030: 77 65 72 65 64 2D 42 79   3A 20 4A 53 50 2F 32 2E  wered-By: JSP/2.
0040: 32 0D 0A 53 65 74 2D 43   6F 6F 6B 69 65 3A 20 4A  2..Set-Cookie: J
0050: 53 45 53 53 49 4F 4E 49   44 3D 53 75 79 36 68 4E  SESSIONID=Suy6hN
0060: 50 4B 49 31 54 5A 56 36   36 6A 46 78 4D 76 70 41  PKI1TZV66jFxMvpA
0070: 55 70 3B 20 50 61 74 68   3D 2F 74 65 73 74 3B 20  Up; Path=/test; 
0080: 53 65 63 75 72 65 0D 0A   43 6F 6E 74 65 6E 74 2D  Secure..Content-
0090: 54 79 70 65 3A 20 74 65   78 74 2F 68 74 6D 6C 3B  Type: text/html;
00A0: 63 68 61 72 73 65 74 3D   49 53 4F 2D 38 38 35 39  charset=ISO-8859
00B0: 2D 31 0D 0A 43 6F 6E 74   65 6E 74 2D 4C 65 6E 67  -1..Content-Leng
00C0: 74 68 3A 20 33 33 0D 0A   44 61 74 65 3A 20 53 61  th: 33..Date: Sa
00D0: 74 2C 20 31 38 20 41 75   67 20 32 30 31 32 20 31  t, 18 Aug 2012 1
00E0: 35 3A 33 39 3A 32 31 20   47 4D 54 0D 0A 0D 0A 48  5:39:21 GMT....H
00F0: 65 6C 6C 6C 6C 6C 6C 6C   6C 6C 6C 6C 6C 6F 6F 6F  ellllllllllllooo
0100: 6F 6F 6F 6F 6F 6F 6F 6F   6F 6F 6F 6F 6F 6F 6F 0A  ooooooooooooooo.
0110: FF EB 8A CF 9F 1D 78 F3   94 ED 45 9A B2 B0 A9 DB  ......x...E.....
response code : 200
Received Data: as Following:


Helllllllllllloooooooooooooooooo

.
.
Thanks 🙂
MiddlewareMagic Team


Accessing EJB3 Remotely over SSL in JBossAS7.1.1.Final

Hi,

In our previous demos we have already seen that how to remotely access the EJBs deployed on “JBoss AS 7.1.1.Final”. So in this example we will see how to invoke an EJB in a Secured manner over SSL (Secure Socket Layer). Here we will use the “jboss-ejb3.xml” file which is a new container specific deployment descriptor for the EJBs. Also we will an alternative option of defining the security domain for our ejbs using annotation “@org.jboss.ejb3.annotation.SecurityDomain”. Additionally we will create SSL Certificates and configure the JBoss Remoting to use the SSL so that the EJB communitation between client and JBossAS7.1.1.Final will be done in Secured Manner.

In this article we are going to see an easiest way to lookup a Secured EJBs remotely in >”JBoss AS7.1.1.Final”

Point-1). We will see How to create SSL Certificates and How to add the Client’s Public certificate/key in Server’s keyStore and how to store Server’s Public Certificate/Key on Client’s Keystore (truststore). And How to configure it in JBossAS7 configuration.

Point-2). How to create a separate Security Realm for our EJBs inside “standalone-full.xml”.

Point-3). How to create a separate Security Domain for our EJBs inside “standalone-full.xml”.

Point-4). How to use the “jboss-ejb3.xml” file inside the EJB jar file in order to associate it with the security domain?

Point-5). How to use the annotation “@org.jboss.ejb3.annotation.SecurityDomain” sothat we will not need to write the addiaional deployment descriptor “jboss-ejb3.xml”

Point-6). A properties file need to be placed in the Clients CLASSPATH with name “jboss-ejb-client.properties”, with some additional properties.

The whole article will be divided into two Parts 1) the Server side configuration and 2). the Application Level Settings from the Client side.

Source Code (Git Repo) Source Code for this Demo Can be downloaded from GIT Repository:
https://github.com/jaysensharma/MiddlewareMagicDemos/tree/master/EJB3_Over_SSL_JBossAS711

JBossAS7 side configuration changes

Here we will first see what all changes are required from the JBoss side in order to create a separate Security Realm and Security Domain for our EJBs.

Step-1). Open a command prompt and make sure that the JDK bin directory is present in the classpath, because the “keytool” which we are going to use in order to create certificate is present in the PATH and then run the following command to create JBoss Keystore.

For Unix Based OS:
export PATH=/home/userone/jdk1.6.0_21/bin:$PATH

For Windows Based OS:
set PATH=C:/jdk1.6.0_21/bin;%PATH%

As the PATH is set properly so we will create the Server and clients certificate as following:

# Create Server Key Store
keytool -genkey -v -alias jbossalias -keyalg RSA -keysize 1024 -keystore jbossServer.keystore -validity 3650 -keypass JBossPassword -storepass JBossPassword -dname "CN=localhost, OU=JBoss Unit, O=JBoss, L=Pune, S=Maharashtra, C=IN"

# Exporting Server's Public Key
keytool -export -keystore jbossServer.keystore -alias jbossalias -file serverPublicKey.cer -keypass JBossPassword -storepass JBossPassword


# Create Client Key Store
keytool -genkey -v -alias clientalias -keyalg RSA -keysize 1024 -keystore jbossClient.keystore -validity 3650 -keypass clientPassword -storepass clientPassword -dname "CN=localhost, OU=Client Unit, O=JBoss, L=Pune, S=Maharashtra, C=IN"


# Exporting Client's Public Key
keytool -export -keystore jbossClient.keystore -alias clientalias -file clientPublicKey.cer -keypass clientPassword -storepass clientPassword

Above commands will create the following files:
“jbossServer.keystore” == This is Server’s keystore which we need to place inside “$JBOSS_HOME/standaone/configuration/” directory.

“serverPublicKey.cer” == This is the Server’s public key which later Client will import in their Client Keystore.

“jbossClient.keystore” == This is Client’s keystore which we need to place on the client side and will pass it to the Client program using JAVA_OPTIONS “-Djavax.net.ssl.trustStore=certificates/jbossClient.keystore”

“clientPublicKey.cer” == This is the Clients’s public key which later Server will import in their Server Keystore.

Step-2). Now we we created the Server / Client Keystore and their Public Keys so we will not run the following commands in order to Import Client’s Public Key on Server’s Keystore and Server’s Public Key on Client’s Keystore as following:

# Importing Client's Public key into server's truststore
keytool -import -v -trustcacerts -alias clientalias -file clientPublicKey.cer -keystore jbossServer.keystore -keypass JBossPassword -storepass JBossPassword

__________
OUTPUT
__________
Owner: CN=localhost, OU=Client Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
Issuer: CN=localhost, OU=Client Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
Serial number: 4fef590d
Valid from: Sun Jul 01 01:22:45 IST 2012 until: Wed Jun 29 01:22:45 IST 2022
Certificate fingerprints:
	 MD5:  9B:4A:A2:5D:7C:15:8A:B8:01:00:84:69:C3:8C:66:5B
	 SHA1: 9C:C1:05:34:EE:D9:6C:A2:6D:85:97:EA:52:F4:7D:E5:2C:B9:DB:04
	 Signature algorithm name: SHA1withRSA
	 Version: 3
Trust this certificate? [no]:  yes
Certificate was added to keystore
[Storing jbossServer.keystore]

And

# Importing Server's Public key into client's truststore
keytool -import -v -trustcacerts -alias jbossalias -file serverPublicKey.cer -keystore jbossClient.keystore -keypass clientPassword -storepass  clientPassword

__________
OUTPUT
__________
Owner: CN=localhost, OU=JBoss Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
Issuer: CN=localhost, OU=JBoss Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
Serial number: 4fef590c
Valid from: Sun Jul 01 01:22:44 IST 2012 until: Wed Jun 29 01:22:44 IST 2022
Certificate fingerprints:
	 MD5:  BD:0C:57:5D:26:64:EE:F4:6E:7E:E6:9C:E7:D0:DD:46
	 SHA1: BF:DF:22:29:54:80:BF:9B:7E:F5:48:7F:02:D5:76:9A:84:D4:09:BE
	 Signature algorithm name: SHA1withRSA
	 Version: 3
Trust this certificate? [no]:  yes
Certificate was added to keystore
[Storing jbossClient.keystore]

Step-3). Open the “$JBOSS_HOME/standaone/configuration/standalone-full.xml” file and then add a new Security Realm there inside the tag as following:

  <security-realm name="EJBRealm">
    <server-identities>
      <ssl>
        <keystore path="jbossServer.keystore" relative-to="jboss.server.config.dir" password="JBossPassword"/>
      </ssl>
    </server-identities>
    <authentication>
      <jaas name="ejb-security-domain"/>
    </authentication>
  </security-realm>

If you are using JBossAS7.1.2 or higher then rather than using [password=”JBossPassword”] you will need to use [keystore-password=”JBossPassword”] as the keystore Tag’s attribute is changed.

Step-4). As the above Security Realm is pointing to a security Domain “ejb-security-domain” so let’s create a new Security Realm inside the [subsystem xmlns=”urn:jboss:domain:security:1.1″] subsystem as following:

     <security-domain name="ejb-security-domain" cache-type="default">
         <authentication>
           <login-module code="Remoting" flag="optional">
             <module-option name="password-stacking" value="useFirstPass"/>
           </login-module>
           <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
             <module-option name="defaultUsersProperties" value="${jboss.server.config.dir}/ejb-users.properties"/>
             <module-option name="defaultRolesProperties" value="${jboss.server.config.dir}/ejb-roles.properties"/>
             <module-option name="usersProperties" value="${jboss.server.config.dir}/ejb-users.properties"/>
             <module-option name="rolesProperties" value="${jboss.server.config.dir}/ejb-roles.properties"/>
             <module-option name="password-stacking" value="useFirstPass"/>
           </login-module>
         </authentication>
     </security-domain>

Step-5). Also as we know that the EJBs are accessed remotely using the JBoss Remoting so we will need to make sure that the remoting subsystem is also using the Security Realm (EJBRealm) which we created as following:

    <subsystem xmlns="urn:jboss:domain:remoting:1.1">
       <connector name="remoting-connector" socket-binding="remoting" security-realm="EJBRealm"/>
    </subsystem>

Step-6). As our Security domain is using two properties file so we will need to create those properties file as well inside “$JBOSS_HOME/standaone/configuration/” as following:

ejb-users.properties

ejbUser=ejbPassword

ejb-roles.properties

ejbUser=ejbRole

Step-7). *** NOTE: Before running your Server make sure that you have copied the “jbossServer.keystore” file inside “$JBOSS_HOME/standaone/configuration/” directory. . Now start the JBoss AS7.1.1.Final as following:

./standalone.sh -c standalone-full.xml

Developing Secure EJB3 Application

As the Server side configurations are done so now we will proceed with developing the Secure EJB3 application.

Step-8). Create a directory somewhere in your file system like “/home/userone/EJB3_Over_SSL” and then create another directory with name “src” inside the “/home/userone/EJB3_Over_SSL” directory.

Step-9). Write the EJB Stateless Bean class “CallerBean.java” as following inside the directory “/home/userone/EJB3_Over_SSL/src”:

package remote;
import javax.ejb.*;
import javax.naming.*;
import java.util.*;
import javax.annotation.Resource;
import javax.annotation.security.DeclareRoles;
import javax.annotation.security.RolesAllowed;
import javax.ejb.LocalBean;
import javax.ejb.SessionContext;

@Stateless  
@Remote(CallerRemote.class)

/*
   If you dont want to use "META-INF/jboss-ejb3.xml" then you can use 
   the following annotation to defing your security-domain
   @org.jboss.ejb3.annotation.SecurityDomain("ejb-security-domain")
*/

public class CallerBean implements CallerRemote
 {
     @Resource
     private SessionContext sessionContext;

     @RolesAllowed("ejbRole")
     public String testMethod(String name)
	    {
		   System.out.println("nntBean's testMethod(String name) called....");
                   System.out.println("nntUserName: '" + sessionContext.getCallerPrincipal().getName() + "' is able to access testMethod()");
                   if (sessionContext.isCallerInRole("ejbRole"))
                         System.out.println("tUser is in   "ejbRole"   ");
                   else
                         System.out.println("tUser is NOT in an allowed role");
		   return "[CallerBean] testMethod() returned Hello "+name;
	    }


     public String commonMethod(String name)
	    {
		   System.out.println("nntBean's commonMethod(String name) called....");
                   System.out.println("nnUser " + sessionContext.getCallerPrincipal().getName() + " is able to access commonMethod()");
                   if (sessionContext.isCallerInRole("ejbRole"))
                         System.out.println("t##### commonMethod()  User is in ejbRole");
                   else
                         System.out.println("t##### commonMethod()  User is NOT in ejbRole");
		   return "[CallerBean] commonMethod() returned Hello "+name;
	    }
 }

Step-10). Write the EJB Remote Interface “CallerRemote.java” as following inside the directory “/home/userone/EJB3_Over_SSL/src”:

package remote;
public interface CallerRemote
{
     public String testMethod(String name);
     public String commonMethod(String name);
}

Step-11). In order to secure the EJB we will define the security domain inside the “jboss-ejb3.xml” file. Spo create a file with this name inside “/home/userone/EJB3_Over_SSL/src” as following:


<?xml version="1.0"?>  
<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
   xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:s="urn:security"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
   http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
   version="3.1"
   impl-version="2.0">
  <assembly-descriptor>
    <s:security>
      <ejb-name>*</ejb-name>
          <s:security-domain>ejb-security-domain</s:security-domain>
    </s:security>
  </assembly-descriptor>

</jboss:ejb-jar>

Step-12). As we are going to create an EAR file containing the above Stateless Session Bean so We will write the “application.xml” as following inside the directory “/home/userone/EJB3_Over_SSL/src”:

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" id="Application_ID" version="5">
  <module>
    <ejb>remoteEJB.jar</ejb>
  </module>
</application>

Developing EJB3 Remote Client

Step-13). Now we will write the Client side code to access the Above mentioned EJB Remotely so create a class “TestRemoteClientA.java” as following inside the directory “/home/userone/EJB3_Over_SSL/src”:

package client;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Properties;
import remote.CallerRemote;
public class TestRemoteClientA
  {
      public static void main(String ar[]) throws Exception 
       {
          Context context=null;
       try
         {
                Properties props = new Properties();
                props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
                props.put(Context.PROVIDER_URL, "remote://localhost:4447"); 
                props.put(Context.SECURITY_PRINCIPAL, "ejbUser");
                props.put(Context.SECURITY_CREDENTIALS, "ejbPassword");

                props.put("jboss.naming.client.remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED","true");
                props.put("jboss.naming.client.connect.options.org.xnio.Options.SSL_STARTTLS","true");

                props.put("jboss.naming.client.ejb.context", true);
                props.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
                context = new InitialContext(props);	
	        System.out.println("nt--------------------------nGot initial Context: "+context);		
         }
       catch (Exception e)
         {
                e.printStackTrace();
          }

         // Lookup Format will be 
         // <app-name>/<module-name>/<distinct-name>/<bean-name>!<fully-qualified-classname-of-the-remote-interface>
   
         CallerRemote remote=(CallerRemote)context.lookup("TestRemoteEJBEAR/remoteEJB//CallerBean!remote.CallerRemote");
         //System.out.println("nt remote.testMethod("Common-MiddlewareMagic") = "+remote.commonMethod("Common-MiddlewareMagic"));

         System.out.println("nt remote.testMethod("MiddlewareMagic") = "+remote.testMethod("MiddlewareMagic"));
       }
  }

Step-14). Now we will need to create a properties file “jboss-ejb-client.properties” as following inside the directory “/home/userone/EJB3_Over_SSL/src”:


remote.connections=testEJB
remote.connection.testEJB.port=4447
remote.connection.testEJB.host=localhost
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=true
remote.connection.testEJB.connect.options.org.xnio.Options.SSL_STARTTLS=true
remote.connection.testEJB.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=true
remote.connection.testEJB.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT=false
remote.connection.testEJB.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=JBOSS-LOCAL-USER

NOTE: The above properties file need to be present inside the client’s classpath. In our case we are going to put this file inside a JAR file “remoteEJBClient.jar” and then we will add this JAR inside the client’s classpath.

Step-15). Almost everything is done, so we will create a client side logging file sothat we will get the desired logging at the Remote EJB Client side. So lets create a file “logging.properties” inside “/home/userone/EJB3_Over_SSL/src” as following:


# Logging
handlers =  java.util.logging.ConsoleHandler
.level = ALL
INFO

# Console Logging
java.util.logging.ConsoleHandler.level=SEVERE

Step-16). Now the most important part of building / deploying and running the application so in order to achieve that we will create a simple ant build script, So Create a “build.xml” file inside the “/home/userone/EJB3_Over_SSL” directory as following:

<project name="EJB3_SSLBased_SecurityDomain_Service" default="all">
<property name="jboss.home" value="/NotBackedUp/JBoss_All/jboss-as-7.1.1.Final" />
<property name="jboss.module.dir" value="${jboss.home}/modules" />
<property name="basedir" value="." />
<property name="tmp.dir" value="tmp" />
<property name="src.dir" value="src" />
<property name="output.dir" value="build" />
<property name="ear.name" value="TestRemoteEJBEAR.ear" />
<property name="ejb.jar" value="remoteEJB.jar" />
<property name="client.jar.name" value="remoteEJBClient.jar" />

        <path id="jboss.classpath">
           <fileset dir="${jboss.module.dir}">
               <include name="**/*.jar"/>
           </fileset>  
        </path>

        <!-- Client Needs the following Jar to be present in the CLASSPATH including -->
        <path id="jboss.new.client.classpath">
          <!-- <fileset dir="${jboss.home}/bin/client">  -->
           <fileset dir="${jboss.home}/bin/client" >
               <include name="jboss-client.jar" />
           </fileset>  
           <fileset dir="/NotBackedUp/MyJdks/jdk1.6.0_21/jre/lib">
               <include name="rt.jar" />
           </fileset>  
        </path>
	 
        <target name="all" depends="deploy" />

        <target name="build_ear">
           <delete dir="${tmp.dir}" />
           <mkdir dir="${tmp.dir}/META-INF" />
           <javac srcdir="${src.dir}" destdir="${tmp.dir}"  includes="*.java" excludes="TestRemoteClientA.java" classpathref="jboss.classpath"/>
           <copy file="${src.dir}/jboss-ejb3.xml" todir="${tmp.dir}/META-INF"/>
           <jar jarfile="${tmp.dir}/${ejb.jar}" basedir="${tmp.dir}" compress="true" />

           <delete file="${tmp.dir}/ejb-users.properties"/>
           <delete file="${tmp.dir}/ejb-roles.properties"/>
           <delete file="${tmp.dir}/META-INF/jboss-ejb3.xml"/>

           <delete includeEmptyDirs="true">
              <fileset dir="${tmp.dir}/remote"/>
           </delete> 
           <mkdir dir="${tmp.dir}/META-INF"/>
           <copy todir="${tmp.dir}/META-INF">
                <fileset dir="${src.dir}/">
                  <include name="application.xml"/> 
                </fileset>
           </copy>           
           <jar jarfile="${tmp.dir}/${ear.name}" basedir="${tmp.dir}" compress="true" />
           <delete includeEmptyDirs="true">
              <fileset dir="${tmp.dir}/META-INF"/>
           </delete> 
           <delete file="${tmp.dir}/${ejb.jar}"/>

           <copy file="${tmp.dir}/${ear.name}" tofile="${output.dir}/${ear.name}"/>
           <delete file="${tmp.dir}/${ear.name}"/>
        </target>


        <target name="deploy" depends="build_ear">
            <echo message="*******************  Deploying the EAR file ${ear.name} *********************" />  
            <echo message="********** ${output.dir}/${ear.name} to ${jboss.home}/standalone/deployments **********" />  
            <copy todir="${jboss.home}/standalone/deployments/">
                <fileset dir="${output.dir}/">
                  <include name="${ear.name}"/> 
                </fileset>
            </copy>
            <echo message="*******************  Deployed Successfully   *********************" />  
        </target>


        <target name="run">
           <delete dir="${tmp.dir}" />
           <mkdir dir="${tmp.dir}" />
           <copy file="${src.dir}/jboss-ejb-client.properties" toDir="${tmp.dir}"/> 

           <javac srcdir="${src.dir}" destdir="${tmp.dir}"  includes="CallerRemote.java,TestRemoteClientA.java" classpathref="jboss.classpath"/>          
           <jar jarfile="${output.dir}/${client.jar.name}" basedir="${tmp.dir}" compress="true" />
           <delete dir="${tmp.dir}"/>

           <java classname="client.TestRemoteClientA" fork="true">
               <classpath>
                  <pathelement location="${output.dir}/${client.jar.name}"/>
                  <path refid="jboss.new.client.classpath"/>
               </classpath>

               <sysproperty key="java.util.logging.manager" value="java.util.logging.LogManager"/>
               <sysproperty key="java.util.logging.config.file" value="logging.properties"/>
               <sysproperty key="java.util.logging.ConsoleHandler.level" value="TRACE" />

               <!-- SSL Related System Properties -->
               <sysproperty key="javax.net.ssl.trustStore" value="certificates/jbossClient.keystore"/>
               <sysproperty key="javax.net.ssl.trustStorePassword" value="clientPassword"/>
               <sysproperty key="javax.net.debug" value="all"/>

           </java>
        </target>        
    
</project>


NOTE: The only change in the above file you need to do is to change the “jboss.home” directory path in the second line of the above script to point to your own JBoss AS7 directory.

Step-17). Now before running your ANT script to build and deploy the above webapplication you should have the ANT as well as JAVA set in the $PATH variable of the Shell / command prompt as following:

For Unix Based OS:
export PATH=/home/userone/jdk1.6.0_21/bin:/home/userone/org.apache.ant_1.6.5/bin:$PATH

For Windows Based OS:
set PATH=C:/jdk1.6.0_21/bin;C:/org.apache.ant_1.6.5/bin;%PATH%

Step-18). Now once the PATH is set In the command/Shell prompt you can move inside the directory “/home/userone/EJB3_Over_SSL” and then run the ant to build and deploy the EJB based EAR applicationon your JBoss Standalone full profile, by running the command “ant deploy”

[userone@localhost EJB3_Over_SSL]$ ant deploy
Buildfile: build.xml

build_ear:
    [mkdir] Created dir: /home/userone/EJB3_Over_SSL/tmp/META-INF
    [javac] Compiling 2 source files to /home/userone/EJB3_Over_SSL/tmp
     [copy] Copying 1 file to /home/userone/EJB3_Over_SSL/tmp/META-INF
      [jar] Building jar: /home/userone/EJB3_Over_SSL/tmp/remoteEJB.jar
   [delete] Deleting: /home/userone/EJB3_Over_SSL/tmp/META-INF/jboss-ejb3.xml
     [copy] Copying 1 file to /home/userone/EJB3_Over_SSL/tmp/META-INF
      [jar] Building jar: /home/userone/EJB3_Over_SSL/tmp/TestRemoteEJBEAR.ear
   [delete] Deleting: /home/userone/EJB3_Over_SSL/tmp/remoteEJB.jar
     [copy] Copying 1 file to /home/userone/EJB3_Over_SSL/build
   [delete] Deleting: /home/userone/EJB3_Over_SSL/tmp/TestRemoteEJBEAR.ear

deploy:
     [echo] *******************  Deploying the EAR file TestRemoteEJBEAR.ear *********************
     [echo] ********** build/TestRemoteEJBEAR.ear to /home/userone/jboss-as-7.1.1.Final//standalone/deployments **********
     [copy] Copying 1 file to /home/userone/jboss-as-7.1.1.Final//standalone/deployments
     [echo] *******************  Deployed Successfully   *********************

all:

BUILD SUCCESSFUL
Total time: 2 seconds

Step-19). NOTE: Before running the program make sure that the “jbossClient.keystore” is placed inside the “/home/userone/EJB3_Over_SSL/certificates” directory. Now we will try to compile and run the EJB3 remote Client application by running the command “ant run”

[userone@localhost EJB3_Over_SSL]$ ant run
Buildfile: build.xml

run:
   [delete] Deleting directory /home/userone/EJB3_Over_SSL/tmp
    [mkdir] Created dir: /home/userone/EJB3_Over_SSL/tmp
     [copy] Copying 1 file to /home/userone/EJB3_Over_SSL/tmp
    [javac] Compiling 2 source files to /home/userone/EJB3_Over_SSL/tmp
      [jar] Building jar: /home/userone/EJB3_Over_SSL/build/remoteEJBClient.jar
   [delete] Deleting directory /home/userone/EJB3_Over_SSL/tmp
      
      	--------------------------
      Got initial Context: javax.naming.InitialContext@5ff3ce5c
      
      	 remote.testMethod("MiddlewareMagic") = [CallerBean] testMethod() returned Hello MiddlewareMagic

BUILD SUCCESSFUL
Total time: 3 seconds

Debugging SSL Communication

If you want to debug the SSL Communication then enable the “<sysproperty key=”javax.net.debug” value=”all”/>” system property in the Client “run” task in “build.xml” . then while starting the client program you will see the following kind of SSL Communication.

[userone@localhost EJB3_Over_SSL]$ ant run
ant run
Buildfile: build.xml

run:
   [delete] Deleting directory /home/userone/EJB3_Over_SSL/tmp
    [mkdir] Created dir: /home/userone/EJB3_Over_SSL/tmp
     [copy] Copying 1 file to /home/userone/EJB3_Over_SSL/tmp
    [javac] Compiling 2 source files to /home/userone/EJB3_Over_SSL/tmp
      [jar] Building jar: /home/userone/EJB3_Over_SSL/build/remoteEJBClient.jar
   [delete] Deleting directory /home/userone/EJB3_Over_SSL/tmp


      keyStore is : 
      keyStore type is : jks
      keyStore provider is : 
      init keystore
      init keymanager of type SunX509
      trustStore is: certificates/jbossClient.keystore
      trustStore type is : jks
      trustStore provider is : 
      init truststore
      adding as trusted cert:
        Subject: CN=localhost, OU=JBoss Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
        Issuer:  CN=localhost, OU=JBoss Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
        Algorithm: RSA; Serial number: 0x4fef590c
        Valid from Sun Jul 01 01:22:44 IST 2012 until Wed Jun 29 01:22:44 IST 2022
      
      adding as trusted cert:
        Subject: CN=localhost, OU=Client Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
        Issuer:  CN=localhost, OU=Client Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
        Algorithm: RSA; Serial number: 0x4fef590d
        Valid from Sun Jul 01 01:22:45 IST 2012 until Wed Jun 29 01:22:45 IST 2022
      
      trigger seeding of SecureRandom
      done seeding SecureRandom
      Using SSLEngineImpl.
      %% No cached client session
      *** ClientHello, TLSv1
      RandomCookie:  GMT: 1324357980 bytes = { 110, 34, 249, 61, 71, 63, 18, 48, 41, 193, 247, 1, 150, 204, 40, 254, 85, 104, 159, 105, 26, 29, 243, 75, 81, 145, 157, 145 }
      Session ID:  {}
      Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
      Compression Methods:  { 0 }
      ***
      [write] MD5 and SHA1 hashes:  len = 73
      0000: 01 00 00 45 03 01 4F F0   19 5C 6E 22 F9 3D 47 3F  ...E..O..n".=G?
      0010: 12 30 29 C1 F7 01 96 CC   28 FE 55 68 9F 69 1A 1D  .0).....(.Uh.i..
      0020: F3 4B 51 91 9D 91 00 00   1E 00 04 00 05 00 2F 00  .KQ.........../.
      0030: 33 00 32 00 0A 00 16 00   13 00 09 00 15 00 12 00  3.2.............
      0040: 03 00 08 00 14 00 11 01   00                       .........
      Remoting "config-based-naming-client-endpoint" read-1, WRITE: TLSv1 Handshake, length = 73
      [write] MD5 and SHA1 hashes:  len = 98
      0000: 01 03 01 00 39 00 00 00   20 00 00 04 01 00 80 00  ....9... .......
      0010: 00 05 00 00 2F 00 00 33   00 00 32 00 00 0A 07 00  ..../..3..2.....
      0020: C0 00 00 16 00 00 13 00   00 09 06 00 40 00 00 15  ............@...
      0030: 00 00 12 00 00 03 02 00   80 00 00 08 00 00 14 00  ................
      0040: 00 11 4F F0 19 5C 6E 22   F9 3D 47 3F 12 30 29 C1  ..O..n".=G?.0).
      0050: F7 01 96 CC 28 FE 55 68   9F 69 1A 1D F3 4B 51 91  ....(.Uh.i...KQ.
      0060: 9D 91                                              ..
      Remoting "config-based-naming-client-endpoint" read-1, WRITE: SSLv2 client hello message, length = 98
      [Raw write]: length = 100
      0000: 80 62 01 03 01 00 39 00   00 00 20 00 00 04 01 00  .b....9... .....
      0010: 80 00 00 05 00 00 2F 00   00 33 00 00 32 00 00 0A  ....../..3..2...
      0020: 07 00 C0 00 00 16 00 00   13 00 00 09 06 00 40 00  ..............@.
      0030: 00 15 00 00 12 00 00 03   02 00 80 00 00 08 00 00  ................
      0040: 14 00 00 11 4F F0 19 5C   6E 22 F9 3D 47 3F 12 30  ....O..n".=G?.0
      0050: 29 C1 F7 01 96 CC 28 FE   55 68 9F 69 1A 1D F3 4B  ).....(.Uh.i...K
      0060: 51 91 9D 91                                        Q...
      [Raw read]: length = 5
      0000: 16 03 01 02 A9                                     .....
      [Raw read]: length = 681
      0000: 02 00 00 46 03 01 4F F0   19 5C 6A F6 F0 B2 5A B1  ...F..O..j...Z.
      0010: 13 57 19 92 A7 4A D2 CF   57 FF 54 EB 72 DC 94 D9  .W...J..W.T.r...
      0020: 20 92 41 1A 1C 1D 20 4F   F0 19 5C D0 F5 36 B9 F4   .A... O....6..
      0030: A7 AD FE C7 9C 83 64 74   BA 73 5C D1 01 08 B5 B4  ......dt.s.....
      0040: 88 98 D4 71 51 D0 A8 00   04 00 0B 00 02 57 00 02  ...qQ........W..
      0050: 54 00 02 51 30 82 02 4D   30 82 01 B6 A0 03 02 01  T..Q0..M0.......
      0060: 02 02 04 4F EF 59 0C 30   0D 06 09 2A 86 48 86 F7  ...O.Y.0...*.H..
      0070: 0D 01 01 05 05 00 30 6B   31 0B 30 09 06 03 55 04  ......0k1.0...U.
      0080: 06 13 02 49 4E 31 14 30   12 06 03 55 04 08 13 0B  ...IN1.0...U....
      0090: 4D 61 68 61 72 61 73 68   74 72 61 31 0D 30 0B 06  Maharashtra1.0..
      00A0: 03 55 04 07 13 04 50 75   6E 65 31 0E 30 0C 06 03  .U....Pune1.0...
      00B0: 55 04 0A 13 05 4A 42 6F   73 73 31 13 30 11 06 03  U....JBoss1.0...
      00C0: 55 04 0B 13 0A 4A 42 6F   73 73 20 55 6E 69 74 31  U....JBoss Unit1
      00D0: 12 30 10 06 03 55 04 03   13 09 6C 6F 63 61 6C 68  .0...U....localh
      00E0: 6F 73 74 30 1E 17 0D 31   32 30 36 33 30 31 39 35  ost0...120630195
      00F0: 32 34 34 5A 17 0D 32 32   30 36 32 38 31 39 35 32  244Z..2206281952
      0100: 34 34 5A 30 6B 31 0B 30   09 06 03 55 04 06 13 02  44Z0k1.0...U....
      0110: 49 4E 31 14 30 12 06 03   55 04 08 13 0B 4D 61 68  IN1.0...U....Mah
      0120: 61 72 61 73 68 74 72 61   31 0D 30 0B 06 03 55 04  arashtra1.0...U.
      0130: 07 13 04 50 75 6E 65 31   0E 30 0C 06 03 55 04 0A  ...Pune1.0...U..
      0140: 13 05 4A 42 6F 73 73 31   13 30 11 06 03 55 04 0B  ..JBoss1.0...U..
      0150: 13 0A 4A 42 6F 73 73 20   55 6E 69 74 31 12 30 10  ..JBoss Unit1.0.
      0160: 06 03 55 04 03 13 09 6C   6F 63 61 6C 68 6F 73 74  ..U....localhost
      0170: 30 81 9F 30 0D 06 09 2A   86 48 86 F7 0D 01 01 01  0..0...*.H......
      0180: 05 00 03 81 8D 00 30 81   89 02 81 81 00 8A B8 1B  ......0.........
      0190: C9 3E 28 C0 D0 3B 35 78   27 73 CC EE F0 03 5F 39  .>(..;5x's...._9
      01A0: A4 8D 35 B9 DB 45 CB B4   C2 18 57 7B 5C 12 E0 6A  ..5..E....W...j
      01B0: 1E 19 5C ED 0E B5 AB 21   B1 99 5C D6 32 32 75 BA  ......!...22u.
      01C0: D4 D4 B3 BE BF F4 FF 41   53 6F B3 1A 59 CF 8F F6  .......ASo..Y...
      01D0: 28 36 E8 DA 5F 72 1D B5   3B 27 39 7C B4 AE AF C5  (6.._r..;'9.....
      01E0: 19 17 86 10 F2 94 5C F6   24 45 9D F7 A7 7D CE 1D  .......$E......
      01F0: 45 CD D8 0B 92 8C 61 38   0C 03 2A 6E C3 70 A7 49  E.....a8..*n.p.I
      0200: F3 39 32 E6 D2 42 55 69   34 6F DD 45 B9 02 03 01  .92..BUi4o.E....
      0210: 00 01 30 0D 06 09 2A 86   48 86 F7 0D 01 01 05 05  ..0...*.H.......
      0220: 00 03 81 81 00 03 A2 ED   32 FC 46 69 3C 24 13 D2  ........2.Fi<$..
      0230: DA A9 EC 16 CB C0 12 D1   8D 1A D0 A1 AC EB 10 2E  ................
      0240: E0 24 60 5A D5 7B 57 5B   85 ED FF 34 73 E8 0D 42  .$`Z..W[...4s..B
      0250: F3 BC F1 B4 BB C3 22 5F   C8 84 AB D7 65 C8 B1 A4  ......"_....e...
      0260: 59 39 96 06 AE 44 19 0F   0F 85 BC 6D 22 B6 DD EC  Y9...D.....m"...
      0270: 63 31 59 8A 86 6A A1 66   73 C0 CD 78 EB D0 F6 B4  c1Y..j.fs..x....
      0280: 96 02 FF 8D E0 EF D6 63   91 7C 41 01 46 E9 1A 4A  .......c..A.F..J
      0290: 07 61 A1 17 48 2D B3 A5   EB 57 D8 1B 1A FF 67 1D  .a..H-...W....g.
      02A0: 75 2C 97 61 D5 0E 00 00   00                       u,.a.....
      Remoting "config-based-naming-client-endpoint" write-1, READ: TLSv1 Handshake, length = 681
      *** ServerHello, TLSv1
      RandomCookie:  GMT: 1324357980 bytes = { 106, 246, 240, 178, 90, 177, 19, 87, 25, 146, 167, 74, 210, 207, 87, 255, 84, 235, 114, 220, 148, 217, 32, 146, 65, 26, 28, 29 }
      Session ID:  {79, 240, 25, 92, 208, 245, 54, 185, 244, 167, 173, 254, 199, 156, 131, 100, 116, 186, 115, 92, 209, 1, 8, 181, 180, 136, 152, 212, 113, 81, 208, 168}
      Cipher Suite: SSL_RSA_WITH_RC4_128_MD5
      Compression Method: 0
      ***
      %% Created:  [Session-1, SSL_RSA_WITH_RC4_128_MD5]
      ** SSL_RSA_WITH_RC4_128_MD5
      [read] MD5 and SHA1 hashes:  len = 74
      0000: 02 00 00 46 03 01 4F F0   19 5C 6A F6 F0 B2 5A B1  ...F..O..j...Z.
      0010: 13 57 19 92 A7 4A D2 CF   57 FF 54 EB 72 DC 94 D9  .W...J..W.T.r...
      0020: 20 92 41 1A 1C 1D 20 4F   F0 19 5C D0 F5 36 B9 F4   .A... O....6..
      0030: A7 AD FE C7 9C 83 64 74   BA 73 5C D1 01 08 B5 B4  ......dt.s.....
      0040: 88 98 D4 71 51 D0 A8 00   04 00                    ...qQ.....
      *** Certificate chain
      chain [0] = [
      [
        Version: V3
        Subject: CN=localhost, OU=JBoss Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
        Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
      
        Key:  Sun RSA public key, 1024 bits
        modulus: 97411916696004455715650884036315912728020904800771557030856740440315088203408504305929172442979068191350480416459422711766442170797911249673086293976645998139784138189674783077479005052825438145063261803343060485911264409807373232121906144287123313814508797496513262971443028578702660792151284744100478010809
        public exponent: 65537
        Validity: [From: Sun Jul 01 01:22:44 IST 2012,
                     To: Wed Jun 29 01:22:44 IST 2022]
        Issuer: CN=localhost, OU=JBoss Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
        SerialNumber: [    4fef590c]
      
      ]
        Algorithm: [SHA1withRSA]
        Signature:
      0000: 03 A2 ED 32 FC 46 69 3C   24 13 D2 DA A9 EC 16 CB  ...2.Fi<$.......
      0010: C0 12 D1 8D 1A D0 A1 AC   EB 10 2E E0 24 60 5A D5  ............$`Z.
      0020: 7B 57 5B 85 ED FF 34 73   E8 0D 42 F3 BC F1 B4 BB  .W[...4s..B.....
      0030: C3 22 5F C8 84 AB D7 65   C8 B1 A4 59 39 96 06 AE  ."_....e...Y9...
      0040: 44 19 0F 0F 85 BC 6D 22   B6 DD EC 63 31 59 8A 86  D.....m"...c1Y..
      0050: 6A A1 66 73 C0 CD 78 EB   D0 F6 B4 96 02 FF 8D E0  j.fs..x.........
      0060: EF D6 63 91 7C 41 01 46   E9 1A 4A 07 61 A1 17 48  ..c..A.F..J.a..H
      0070: 2D B3 A5 EB 57 D8 1B 1A   FF 67 1D 75 2C 97 61 D5  -...W....g.u,.a.
      
      ]
      ***
      Found trusted certificate:
      [
      [
        Version: V3
        Subject: CN=localhost, OU=JBoss Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
        Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5
      
        Key:  Sun RSA public key, 1024 bits
        modulus: 97411916696004455715650884036315912728020904800771557030856740440315088203408504305929172442979068191350480416459422711766442170797911249673086293976645998139784138189674783077479005052825438145063261803343060485911264409807373232121906144287123313814508797496513262971443028578702660792151284744100478010809
        public exponent: 65537
        Validity: [From: Sun Jul 01 01:22:44 IST 2012,
                     To: Wed Jun 29 01:22:44 IST 2022]
        Issuer: CN=localhost, OU=JBoss Unit, O=JBoss, L=Pune, ST=Maharashtra, C=IN
        SerialNumber: [    4fef590c]
      
      ]
        Algorithm: [SHA1withRSA]
        Signature:
      0000: 03 A2 ED 32 FC 46 69 3C   24 13 D2 DA A9 EC 16 CB  ...2.Fi<$.......
      0010: C0 12 D1 8D 1A D0 A1 AC   EB 10 2E E0 24 60 5A D5  ............$`Z.
      0020: 7B 57 5B 85 ED FF 34 73   E8 0D 42 F3 BC F1 B4 BB  .W[...4s..B.....
      0030: C3 22 5F C8 84 AB D7 65   C8 B1 A4 59 39 96 06 AE  ."_....e...Y9...
      0040: 44 19 0F 0F 85 BC 6D 22   B6 DD EC 63 31 59 8A 86  D.....m"...c1Y..
      0050: 6A A1 66 73 C0 CD 78 EB   D0 F6 B4 96 02 FF 8D E0  j.fs..x.........
      0060: EF D6 63 91 7C 41 01 46   E9 1A 4A 07 61 A1 17 48  ..c..A.F..J.a..H
      0070: 2D B3 A5 EB 57 D8 1B 1A   FF 67 1D 75 2C 97 61 D5  -...W....g.u,.a.
      
      ]
      [read] MD5 and SHA1 hashes:  len = 603
      0000: 0B 00 02 57 00 02 54 00   02 51 30 82 02 4D 30 82  ...W..T..Q0..M0.
      0010: 01 B6 A0 03 02 01 02 02   04 4F EF 59 0C 30 0D 06  .........O.Y.0..
      0020: 09 2A 86 48 86 F7 0D 01   01 05 05 00 30 6B 31 0B  .*.H........0k1.
      0030: 30 09 06 03 55 04 06 13   02 49 4E 31 14 30 12 06  0...U....IN1.0..
      0040: 03 55 04 08 13 0B 4D 61   68 61 72 61 73 68 74 72  .U....Maharashtr
      0050: 61 31 0D 30 0B 06 03 55   04 07 13 04 50 75 6E 65  a1.0...U....Pune
      0060: 31 0E 30 0C 06 03 55 04   0A 13 05 4A 42 6F 73 73  1.0...U....JBoss
      0070: 31 13 30 11 06 03 55 04   0B 13 0A 4A 42 6F 73 73  1.0...U....JBoss
      0080: 20 55 6E 69 74 31 12 30   10 06 03 55 04 03 13 09   Unit1.0...U....
      0090: 6C 6F 63 61 6C 68 6F 73   74 30 1E 17 0D 31 32 30  localhost0...120
      00A0: 36 33 30 31 39 35 32 34   34 5A 17 0D 32 32 30 36  630195244Z..2206
      00B0: 32 38 31 39 35 32 34 34   5A 30 6B 31 0B 30 09 06  28195244Z0k1.0..
      00C0: 03 55 04 06 13 02 49 4E   31 14 30 12 06 03 55 04  .U....IN1.0...U.
      00D0: 08 13 0B 4D 61 68 61 72   61 73 68 74 72 61 31 0D  ...Maharashtra1.
      00E0: 30 0B 06 03 55 04 07 13   04 50 75 6E 65 31 0E 30  0...U....Pune1.0
      00F0: 0C 06 03 55 04 0A 13 05   4A 42 6F 73 73 31 13 30  ...U....JBoss1.0
      0100: 11 06 03 55 04 0B 13 0A   4A 42 6F 73 73 20 55 6E  ...U....JBoss Un
      0110: 69 74 31 12 30 10 06 03   55 04 03 13 09 6C 6F 63  it1.0...U....loc
      0120: 61 6C 68 6F 73 74 30 81   9F 30 0D 06 09 2A 86 48  alhost0..0...*.H
      0130: 86 F7 0D 01 01 01 05 00   03 81 8D 00 30 81 89 02  ............0...
      0140: 81 81 00 8A B8 1B C9 3E   28 C0 D0 3B 35 78 27 73  .......>(..;5x's
      0150: CC EE F0 03 5F 39 A4 8D   35 B9 DB 45 CB B4 C2 18  ...._9..5..E....
      0160: 57 7B 5C 12 E0 6A 1E 19   5C ED 0E B5 AB 21 B1 99  W...j......!..
      0170: 5C D6 32 32 75 BA D4 D4   B3 BE BF F4 FF 41 53 6F  .22u........ASo
      0180: B3 1A 59 CF 8F F6 28 36   E8 DA 5F 72 1D B5 3B 27  ..Y...(6.._r..;'
      0190: 39 7C B4 AE AF C5 19 17   86 10 F2 94 5C F6 24 45  9............$E
      01A0: 9D F7 A7 7D CE 1D 45 CD   D8 0B 92 8C 61 38 0C 03  ......E.....a8..
      01B0: 2A 6E C3 70 A7 49 F3 39   32 E6 D2 42 55 69 34 6F  *n.p.I.92..BUi4o
      01C0: DD 45 B9 02 03 01 00 01   30 0D 06 09 2A 86 48 86  .E......0...*.H.
      01D0: F7 0D 01 01 05 05 00 03   81 81 00 03 A2 ED 32 FC  ..............2.
      01E0: 46 69 3C 24 13 D2 DA A9   EC 16 CB C0 12 D1 8D 1A  Fi<$............
      01F0: D0 A1 AC EB 10 2E E0 24   60 5A D5 7B 57 5B 85 ED  .......$`Z..W[..
      0200: FF 34 73 E8 0D 42 F3 BC   F1 B4 BB C3 22 5F C8 84  .4s..B......"_..
      0210: AB D7 65 C8 B1 A4 59 39   96 06 AE 44 19 0F 0F 85  ..e...Y9...D....
      0220: BC 6D 22 B6 DD EC 63 31   59 8A 86 6A A1 66 73 C0  .m"...c1Y..j.fs.
      0230: CD 78 EB D0 F6 B4 96 02   FF 8D E0 EF D6 63 91 7C  .x...........c..
      0240: 41 01 46 E9 1A 4A 07 61   A1 17 48 2D B3 A5 EB 57  A.F..J.a..H-...W
      0250: D8 1B 1A FF 67 1D 75 2C   97 61 D5                 ....g.u,.a.
      *** ServerHelloDone
      [read] MD5 and SHA1 hashes:  len = 4
      0000: 0E 00 00 00                                        ....
      *** ClientKeyExchange, RSA PreMasterSecret, TLSv1
      [write] MD5 and SHA1 hashes:  len = 134
      0000: 10 00 00 82 00 80 03 04   43 75 EF 72 2E 07 4A ED  ........Cu.r..J.
      0010: 2E 78 00 13 6B 8C C3 A3   88 56 E0 71 3C 3A 68 AE  .x..k....V.q<:h.
      0020: A8 B0 CA F9 CB 27 0F 01   DB 55 F9 B1 9E 99 EC 5E  .....'...U.....^
      0030: 31 BB FB 94 FE A2 7C F5   8F 8D 49 EF 01 F7 AE 69  1.........I....i
      0040: 0B 84 5B 43 7A 7C 47 B3   A0 CE 46 8C 06 B0 36 76  ..[Cz.G...F...6v
      0050: C7 30 42 B1 B9 DC 84 07   DA AC 5F 89 C1 6F 2C D5  .0B......._..o,.
      0060: CF 99 AC B3 E8 AC C6 79   83 E1 58 6C D6 55 86 2B  .......y..Xl.U.+
      0070: 84 D6 3A D0 F9 6B 46 FC   F6 F9 47 A8 E2 41 82 5F  ..:..kF...G..A._
      0080: 95 02 1E AE 4E E0                                  ....N.
      Remoting "config-based-naming-client-endpoint" write-1, WRITE: TLSv1 Handshake, length = 134
      SESSION KEYGEN:
      PreMaster Secret:
      0000: 03 01 AC 7D FE 2C DE E8   96 19 47 B0 9C 36 2B 11  .....,....G..6+.
      0010: D7 83 58 D5 FF FE 2C AE   E0 20 95 B1 B0 9A EC 68  ..X...,.. .....h
      0020: 82 51 BA 98 4B 94 C4 E4   E7 EF FC B6 68 18 F6 FD  .Q..K.......h...
      CONNECTION KEYGEN:
      Client Nonce:
      0000: 4F F0 19 5C 6E 22 F9 3D   47 3F 12 30 29 C1 F7 01  O..n".=G?.0)...
      0010: 96 CC 28 FE 55 68 9F 69   1A 1D F3 4B 51 91 9D 91  ..(.Uh.i...KQ...
      Server Nonce:
      0000: 4F F0 19 5C 6A F6 F0 B2   5A B1 13 57 19 92 A7 4A  O..j...Z..W...J
      0010: D2 CF 57 FF 54 EB 72 DC   94 D9 20 92 41 1A 1C 1D  ..W.T.r... .A...
      Master Secret:
      0000: 35 92 7D A3 EE 1F BB 07   76 8A FF 49 52 F9 0D 6E  5.......v..IR..n
      0010: D6 03 08 2C D3 1D F8 4B   E5 A8 1A 22 FA 20 A0 56  ...,...K...". .V
      0020: 69 18 08 57 99 A0 8B 9F   CA 32 1A 09 9D E9 49 BA  i..W.....2....I.
      Client MAC write Secret:
      0000: 16 22 37 98 C8 87 48 6A   C1 CE 7F 9D 6F A6 39 52  ."7...Hj....o.9R
      Server MAC write Secret:
      0000: 68 5B 59 12 54 C5 1B 29   2B D2 86 22 10 F8 CC D1  h[Y.T..)+.."....
      Client write key:
      0000: 67 7B BE 89 EB 94 C5 AA   B8 44 C5 53 80 F0 D9 0D  g........D.S....
      Server write key:
      0000: C9 E5 5C 60 CC 2E DE 19   B6 07 1F 0E B6 B8 01 9D  ..`............
      ... no IV used for this cipher
      Remoting "config-based-naming-client-endpoint" write-1, WRITE: TLSv1 Change Cipher Spec, length = 1
      *** Finished
      verify_data:  { 230, 49, 107, 73, 219, 244, 8, 157, 183, 78, 144, 252 }
      ***
      [write] MD5 and SHA1 hashes:  len = 16
      0000: 14 00 00 0C E6 31 6B 49   DB F4 08 9D B7 4E 90 FC  .....1kI.....N..
      Padded plaintext before ENCRYPTION:  len = 32
      0000: 14 00 00 0C E6 31 6B 49   DB F4 08 9D B7 4E 90 FC  .....1kI.....N..
      0010: 36 64 83 45 B7 B1 E6 7A   04 16 B3 C1 CE CC 9A FA  6d.E...z........
      Remoting "config-based-naming-client-endpoint" write-1, WRITE: TLSv1 Handshake, length = 32
      [Raw write]: length = 139
      0000: 16 03 01 00 86 10 00 00   82 00 80 03 04 43 75 EF  .............Cu.
      0010: 72 2E 07 4A ED 2E 78 00   13 6B 8C C3 A3 88 56 E0  r..J..x..k....V.
      0020: 71 3C 3A 68 AE A8 B0 CA   F9 CB 27 0F 01 DB 55 F9  q<:h......'...U.
      0030: B1 9E 99 EC 5E 31 BB FB   94 FE A2 7C F5 8F 8D 49  ....^1.........I
      0040: EF 01 F7 AE 69 0B 84 5B   43 7A 7C 47 B3 A0 CE 46  ....i..[Cz.G...F
      0050: 8C 06 B0 36 76 C7 30 42   B1 B9 DC 84 07 DA AC 5F  ...6v.0B......._
      0060: 89 C1 6F 2C D5 CF 99 AC   B3 E8 AC C6 79 83 E1 58  ..o,........y..X
      0070: 6C D6 55 86 2B 84 D6 3A   D0 F9 6B 46 FC F6 F9 47  l.U.+..:..kF...G
      0080: A8 E2 41 82 5F 95 02 1E   AE 4E E0                 ..A._....N.
      [Raw write]: length = 6
      0000: 14 03 01 00 01 01                                  ......
      [Raw write]: length = 37
      0000: 16 03 01 00 20 68 AB F3   1F E7 E5 35 EB FF 43 D4  .... h.....5..C.
      0010: C5 00 12 62 C4 9F 8D 3E   DB 53 78 F5 01 0C 92 29  ...b...>.Sx....)
      0020: 79 B8 0D AA 18                                     y....
      [Raw read]: length = 5
      0000: 14 03 01 00 01                                     .....
      [Raw read]: length = 1
      0000: 01                                                 .
      Remoting "config-based-naming-client-endpoint" read-1, READ: TLSv1 Change Cipher Spec, length = 1
      [Raw read]: length = 5
      0000: 16 03 01 00 20                                     .... 
      [Raw read]: length = 32
      0000: 93 FC D6 43 CF 74 1C 77   26 A8 C6 6A 2E F8 2D 25  ...C.t.w&..j..-%
      0010: 48 DE FB 5F B0 70 32 C2   DD A9 CC 67 23 E9 3C 57  H.._.p2....g#.<W
      Remoting "config-based-naming-client-endpoint" read-1, READ: TLSv1 Handshake, length = 32
      Padded plaintext after DECRYPTION:  len = 32
      0000: 14 00 00 0C 4E 55 64 B3   2B BF E4 AB 01 B5 AB 14  ....NUd.+.......
      0010: 10 0C EC 73 84 96 22 FD   DA 4C 37 6F A6 5E E1 72  ...s.."..L7o.^.r
      *** Finished
      verify_data:  { 78, 85, 100, 179, 43, 191, 228, 171, 1, 181, 171, 20 }
      ***
      %% Cached client session: [Session-1, SSL_RSA_WITH_RC4_128_MD5]
      [read] MD5 and SHA1 hashes:  len = 16
      0000: 14 00 00 0C 4E 55 64 B3   2B BF E4 AB 01 B5 AB 14  ....NUd.+.......
      Padded plaintext before ENCRYPTION:  len = 61
      0000: 00 00 00 29 01 00 01 01   03 23 63 6F 6E 66 69 67  ...).....#config
      0010: 2D 62 61 73 65 64 2D 6E   61 6D 69 6E 67 2D 63 6C  -based-naming-cl
      0020: 69 65 6E 74 2D 65 6E 64   70 6F 69 6E 74 82 E7 C1  ient-endpoint...
      0030: AE CB 87 4C 26 91 ED FC   F0 7B 47 27 B7           ...L&.....G'.
      Remoting "config-based-naming-client-endpoint" write-1, WRITE: TLSv1 Application Data, length = 45
      [Raw write (bb)]: length = 66
      0000: 17 03 01 00 3D 75 A4 86   C8 2D 71 32 D5 2C 6F 2D  ....=u...-q2.,o-
      0010: C0 DD 74 78 3A BF 10 84   3D 4C CE D7 E1 67 1A C2  ..tx:...=L...g..
      0020: 16 80 78 E8 37 ED 63 37   42 98 AC 8C CB 29 04 34  ..x.7.c7B....).4
      0030: 2C 2E 75 CD BA 2F F9 A6   32 3B 41 23 9E 09 72 F3  ,.u../..2;A#..r.
      0040: 41 AE                                              A.
      [Raw read (bb)]: length = 65
      0000: 17 03 01 00 3C D8 96 6A   48 29 96 07 23 07 5C 2C  ....<..jH)..#.,
      0010: 06 78 1B 5F B5 F5 0A EF   57 05 91 06 60 FC A1 C3  .x._....W...`...
      0020: CC EB 2A D8 60 90 1A 96   9A 0C 13 53 FE 4B 4B 51  ..*.`......S.KKQ
      0030: 67 32 1D 3C B9 3B 8F 35   15 E0 86 88 47 2A C6 BA  g2.<.;.5....G*..
      0040: B8                                                 .
      Padded plaintext after DECRYPTION:  len = 60
      0000: 00 00 00 28 01 00 01 01   03 09 6C 6F 63 61 6C 68  ...(......localh
      0010: 6F 73 74 01 10 4A 42 4F   53 53 2D 4C 4F 43 41 4C  ost..JBOSS-LOCAL
      0020: 2D 55 53 45 52 01 05 50   4C 41 49 4E 3D A2 00 21  -USER..PLAIN=..!
      0030: BF 3B 29 F3 4D C7 CD BA   5A EF 9E F0              .;).M...Z...
      Padded plaintext before ENCRYPTION:  len = 39
      0000: 00 00 00 13 02 10 4A 42   4F 53 53 2D 4C 4F 43 41  ......JBOSS-LOCA
      0010: 4C 2D 55 53 45 52 00 3F   95 38 E7 C9 B4 83 AF B2  L-USER.?.8......
      0020: 8B 85 96 18 B7 0D 24                               ......$
      Remoting "config-based-naming-client-endpoint" task-1, WRITE: TLSv1 Application Data, length = 23
      [Raw write (bb)]: length = 44
      0000: 17 03 01 00 27 FF 53 BE   A9 F8 ED 6F 4B A1 0E 5B  ....'.S....oK..[
      0010: DB 78 8E 8A 86 F1 83 6D   9B 5E AD A0 A6 C5 3E 60  .x.....m.^....>`
      0020: 4D 3F 12 2A 23 F7 C6 4A   8E CF 05 8C              M?.*#..J....
      [Raw read (bb)]: length = 107
      0000: 17 03 01 00 66 A4 08 16   81 D7 16 83 1A FC 7C E5  ....f...........
      0010: C2 10 CD 2B 82 86 56 D0   DF 4E BA A9 76 AC 3A 9C  ...+..V..N..v.:.
      0020: B6 D0 57 27 27 EC 1F DB   0B 6B FB A5 B3 9C 28 38  ..W''....k....(8
      0030: C3 FD BC B4 62 B2 93 07   BD 10 79 B9 17 24 D9 ED  ....b.....y..$..
      0040: B1 07 4D 0D E7 9B 35 98   60 9A CF C5 1D 57 AB 46  ..M...5.`....W.F
      0050: E4 36 B1 5B 74 09 D1 6A   A4 4B 22 3E 3F DD 15 24  .6.[t..j.K">?..$
      0060: 12 89 CF 8D 91 82 72 4E   BB 0C 2E                 ......rN...
      Padded plaintext after DECRYPTION:  len = 102
      0000: 00 00 00 52 03 2F 4E 6F   74 42 61 63 6B 65 64 55  ...R./NotBackedU
      0010: 70 2F 4A 42 6F 73 73 5F   41 6C 6C 2F 6A 62 6F 73  p/JBoss_All/jbos
      0020: 73 2D 61 73 2D 37 2E 31   2E 31 2E 46 69 6E 61 6C  s-as-7.1.1.Final
      0030: 2F 73 74 61 6E 64 61 6C   6F 6E 65 2F 74 6D 70 2F  /standalone/tmp/
      0040: 61 75 74 68 2F 63 68 61   6C 6C 65 6E 67 65 2D 37  auth/challenge-7
      0050: 31 32 31 33 33 38 A6 85   E0 13 12 99 64 8E 55 DE  121338......d.U.
      0060: 72 E0 02 57 03 EA                                  r..W..
      Padded plaintext before ENCRYPTION:  len = 37
      0000: 00 00 00 11 04 27 5C AF   3C 2F F7 0E DF 65 6A 62  .....'.</...ejb
      0010: 55 73 65 72 00 E7 D1 02   83 DD 0A 00 76 F4 FF 8B  User........v...
      0020: 37 D7 5A 37 19                                     7.Z7.
      Remoting "config-based-naming-client-endpoint" task-2, WRITE: TLSv1 Application Data, length = 21
      [Raw write (bb)]: length = 42
      0000: 17 03 01 00 25 DF 28 09   7B FA 47 98 07 46 14 18  ....%.(...G..F..
      0010: BE DD 48 0F AE 89 1B CB   25 A9 14 06 F7 5E B5 0C  ..H.....%....^..
      0020: 5B 24 4E CA 59 51 38 EE   6F 7F                    [$N.YQ8.o.
      [Raw read (bb)]: length = 26
      0000: 17 03 01 00 15 21 39 4C   83 1A EA 6E 4F 8A 52 A8  .....!9L...nO.R.
      0010: F5 97 65 A7 B6 EC 3A FA   93 02                    ..e...:...
      Padded plaintext after DECRYPTION:  len = 21
      0000: 00 00 00 01 06 E1 D7 97   B8 A5 FE FE C8 B3 59 E5  ..............Y.
      0010: 5B C0 59 E5 C4                                     [.Y..
      Padded plaintext before ENCRYPTION:  len = 61
      0000: 00 00 00 29 01 00 01 01   03 23 63 6F 6E 66 69 67  ...).....#config
      0010: 2D 62 61 73 65 64 2D 6E   61 6D 69 6E 67 2D 63 6C  -based-naming-cl
      0020: 69 65 6E 74 2D 65 6E 64   70 6F 69 6E 74 A0 47 BB  ient-endpoint.G.
      0030: 8A 13 06 99 29 6B 29 F5   A0 5C D4 C8 0B           ....)k).....
      Remoting "config-based-naming-client-endpoint" read-1, WRITE: TLSv1 Application Data, length = 45
      [Raw write (bb)]: length = 66
      0000: 17 03 01 00 3D 78 F6 AF   0E AC 21 D7 35 0A AC 0B  ....=x....!.5...
      0010: C1 E2 1B BF DB 40 AE 0A   30 35 6F 8F 33 4E 0E 7D  .....@..05o.3N..
      0020: 7B FA 3E 5F 84 DF 59 E6   2B DC 6A 27 08 63 1B 3D  ..>_..Y.+.j'.c.=
      0030: 12 CB F8 5B 46 60 F5 4D   17 C3 86 0B 28 C8 EF C5  ...[F`.M....(...
      0040: 09 BD                                              ..
      [Raw read (bb)]: length = 65
      0000: 17 03 01 00 3C BB 3D 70   B6 2C DE 60 98 50 B2 47  ....<.=p.,.`.P.G
      0010: 6F 3A 7F 71 13 34 C8 A1   61 9C EB 0E 3C DA 7A 93  o:.q.4..a...<.z.
      0020: F4 BD 73 DC 82 16 43 9E   4B 47 CE 15 D9 F3 1D ED  ..s...C.KG......
      0030: 83 DF 5C 12 E6 9B B6 E0   80 42 A0 65 A2 3E A4 42  ........B.e.>.B
      0040: 5B                                                 [
      Padded plaintext after DECRYPTION:  len = 60
      0000: 00 00 00 28 01 00 01 01   03 09 6C 6F 63 61 6C 68  ...(......localh
      0010: 6F 73 74 01 10 4A 42 4F   53 53 2D 4C 4F 43 41 4C  ost..JBOSS-LOCAL
      0020: 2D 55 53 45 52 01 05 50   4C 41 49 4E 9E 62 E4 4A  -USER..PLAIN.b.J
      0030: 3F 42 22 C1 85 70 1B DF   B9 80 B2 E9              ?B"..p......
      Padded plaintext before ENCRYPTION:  len = 47
      0000: 00 00 00 1B 02 05 50 4C   41 49 4E 00 65 6A 62 55  ......PLAIN.ejbU
      0010: 73 65 72 00 65 6A 62 50   61 73 73 77 6F 72 64 F0  ser.ejbPassword.
      0020: 6B EB 0A 8B 7E E6 41 FB   DB CD D4 B1 A2 46 79     k.....A......Fy
      Remoting "config-based-naming-client-endpoint" task-3, WRITE: TLSv1 Application Data, length = 31
      [Raw write (bb)]: length = 52
      0000: 17 03 01 00 2F B2 75 CA   90 12 CC BA A2 51 C8 82  ..../.u......Q..
      0010: 2A 12 BB 12 4A 81 2B 9D   8B F3 DD C8 A0 BC 23 12  *...J.+.......#.
      0020: D3 0B B9 81 6E E8 7B C4   F5 41 E0 47 0A 0C DA 8D  ....n....A.G....
      0030: 61 CD FF 49                                        a..I
      [Raw read (bb)]: length = 26
      0000: 17 03 01 00 15 EB F5 9F   8F 1D 42 41 A5 A7 0D FF  ..........BA....
      0010: 3A A1 F7 10 BD 69 8B 89   2A 94                    :....i..*.
      Padded plaintext after DECRYPTION:  len = 21
      0000: 00 00 00 01 05 CF 4F B1   73 4C 25 16 6B 44 C8 1B  ......O.sL%.kD..
      0010: 46 C0 2B 8F D6                                     F.+..
      Padded plaintext before ENCRYPTION:  len = 54
      0000: 00 00 00 22 10 89 FB 8F   55 01 06 6E 61 6D 69 6E  ..."....U..namin
      0010: 67 80 04 00 00 40 00 81   02 00 50 82 04 7F FF FF  g....@....P.....
      0020: FF 83 02 FF FF 00 21 92   8C 03 7D F4 0A 46 55 0A  ......!......FU.
      0030: F1 87 84 8D E6 C8                                  ......
      main, WRITE: TLSv1 Application Data, length = 38
      [Raw write (bb)]: length = 59
      0000: 17 03 01 00 36 9F E0 0B   F0 2D 06 09 EC 25 C7 80  ....6....-...%..
      0010: FD A3 DA AD 0E B8 6D 07   70 3F 37 88 28 3E 7B 25  ......m.p?7.(>.%
      0020: EA AF 4F 93 A9 74 A6 09   00 96 25 A5 46 E7 14 29  ..O..t....%.F..)
      0030: FF F6 A9 83 96 58 56 7E   71 81 34                 .....XV.q.4
      [Raw read (bb)]: length = 41
      0000: 17 03 01 00 24 A1 AE 75   CA 78 DC EA 21 DD 6E B9  ....$..u.x..!.n.
      0010: BE F5 4A E1 31 ED 4D 05   A9 DE F8 75 5E 2D D0 61  ..J.1.M....u^-.a
      0020: 91 24 10 BA 76 DE 4E FD   F1                       .$..v.N..
      Padded plaintext after DECRYPTION:  len = 36
      0000: 00 00 00 10 11 09 FB 8F   55 80 04 00 00 40 00 81  ........U....@..
      0010: 02 00 50 00 FE 8D 7C A1   A3 8A F2 B1 1B 80 50 06  ..P...........P.
      0020: 57 3F 5B D7                                        W?[.
      [Raw read (bb)]: length = 41
      0000: 17 03 01 00 24 7E 57 CA   E6 5C BC 3E B4 A9 87 F9  ....$.W...>....
      0010: BC 62 E1 BE A3 7E FD 70   F2 A3 B5 A9 81 A9 48 B4  .b.....p......H.
      0020: 99 DF 62 97 CE 00 85 2E   A2                       ..b......
      Padded plaintext after DECRYPTION:  len = 36
      0000: 00 00 00 10 30 09 FB 8F   55 69 72 02 6E 61 6D 69  ....0...Uir.nami
      0010: 6E 67 01 01 06 41 C1 F3   2E B0 A9 CF B8 F0 92 75  ng...A.........u
      0020: DE 6E 34 2D                                        .n4-
      [Raw read (bb)]: length = 33
      0000: 17 03 01 00 1C AF 18 D2   55 55 95 27 1A 93 00 97  ........UU.'....
      0010: 92 74 2E FA 26 65 96 47   F0 ED 83 76 7C 0F CF 31  .t..&e.G...v...1
      0020: C4                                                 .
      Padded plaintext after DECRYPTION:  len = 28
      0000: 00 00 00 08 30 09 FB 8F   55 69 72 01 EB 9A 2F 82  ....0...Uir.../.
      0010: BE C3 91 92 A6 0B 2B C1   17 49 F5 11              ......+..I..
      Padded plaintext before ENCRYPTION:  len = 31
      0000: 00 00 00 0B 31 89 FB 8F   55 69 72 00 00 00 10 21  ....1...Uir....!
      0010: 44 FF 52 8E 51 EE AB 75   37 78 1F 29 3C CA 85     D.R.Q..u7x.)<..
      Remoting "config-based-naming-client-endpoint" task-1, WRITE: TLSv1 Application Data, length = 15
      [Raw write (bb)]: length = 36
      0000: 17 03 01 00 1F 13 DD DD   ED 67 B3 9D 70 51 4A 1A  .........g..pQJ.
      0010: B2 02 F1 1B ED 37 F1 DA   58 0C 43 66 A0 33 74 48  .....7..X.Cf.3tH
      0020: FB F5 F8 15                                        ....
      Padded plaintext before ENCRYPTION:  len = 35
      0000: 00 00 00 0F 30 89 FB 8F   55 6A E0 02 6E 61 6D 69  ....0...Uj..nami
      0010: 6E 67 01 5D C1 D3 D3 15   5D B2 71 D8 C8 F3 B8 F1  ng.]....].q.....
      0020: DB 83 DB                                           ...
      main, WRITE: TLSv1 Application Data, length = 19
      [Raw write (bb)]: length = 40
      0000: 17 03 01 00 23 97 D9 7C   15 4E 92 1F BA D9 46 BA  ....#....N....F.
      0010: 99 4E 57 35 33 1B 44 7B   40 2E 8F 5E E2 B9 2D 82  .NW53.D.@..^..-.
      0020: 70 BA 0D 9E 3C F4 81 BB                            p...<...
      Padded plaintext before ENCRYPTION:  len = 28
      0000: 00 00 00 08 30 89 FB 8F   55 6A E0 01 10 D4 FD A2  ....0...Uj......
      0010: 33 C8 42 16 32 EB 84 89   7F F8 29 5D              3.B.2.....)]
      main, WRITE: TLSv1 Application Data, length = 12
      [Raw write (bb)]: length = 33
      0000: 17 03 01 00 1C DC B6 87   31 40 6F B8 95 89 CF C8  ........1@o.....
      0010: 30 F0 09 DB CE CA 3D A3   01 92 65 D2 8E 8D CE F2  0.....=...e.....
      0020: 3C                                                 <
      [Raw read (bb)]: length = 36
      0000: 17 03 01 00 1F 55 F2 3F   1B 5B 01 AC 0E 15 00 02  .....U.?.[......
      0010: 3D 92 E8 17 98 7C 96 C1   13 1C 27 B6 CE 91 F8 DA  =.........'.....
      0020: 41 AB BB 22                                        A.."
      Padded plaintext after DECRYPTION:  len = 31
      0000: 00 00 00 0B 31 09 FB 8F   55 6A E0 00 00 00 0F 7F  ....1...Uj......
      0010: 9A 0D 99 A8 64 40 D1 DE   39 CF 96 16 A4 83 77     ....d@..9.....w
      Using SSLEngineImpl.
      %% Client cached [Session-1, SSL_RSA_WITH_RC4_128_MD5]
      %% Try resuming [Session-1, SSL_RSA_WITH_RC4_128_MD5] from port -1
      *** ClientHello, TLSv1
      RandomCookie:  GMT: 1324357980 bytes = { 130, 188, 205, 110, 140, 21, 112, 88, 211, 129, 209, 98, 71, 129, 207, 70, 168, 102, 10, 186, 64, 77, 105, 50, 96, 173, 151, 226 }
      Session ID:  {79, 240, 25, 92, 208, 245, 54, 185, 244, 167, 173, 254, 199, 156, 131, 100, 116, 186, 115, 92, 209, 1, 8, 181, 180, 136, 152, 212, 113, 81, 208, 168}
      Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
      Compression Methods:  { 0 }
      ***
      [write] MD5 and SHA1 hashes:  len = 105
      0000: 01 00 00 65 03 01 4F F0   19 5C 82 BC CD 6E 8C 15  ...e..O.....n..
      0010: 70 58 D3 81 D1 62 47 81   CF 46 A8 66 0A BA 40 4D  pX...bG..F.f..@M
      0020: 69 32 60 AD 97 E2 20 4F   F0 19 5C D0 F5 36 B9 F4  i2`... O....6..
      0030: A7 AD FE C7 9C 83 64 74   BA 73 5C D1 01 08 B5 B4  ......dt.s.....
      0040: 88 98 D4 71 51 D0 A8 00   1E 00 04 00 05 00 2F 00  ...qQ........./.
      0050: 33 00 32 00 0A 00 16 00   13 00 09 00 15 00 12 00  3.2.............
      0060: 03 00 08 00 14 00 11 01   00                       .........
      Remoting "config-based-ejb-client-endpoint" read-1, WRITE: TLSv1 Handshake, length = 105
      [Raw write]: length = 110
      0000: 16 03 01 00 69 01 00 00   65 03 01 4F F0 19 5C 82  ....i...e..O...
      0010: BC CD 6E 8C 15 70 58 D3   81 D1 62 47 81 CF 46 A8  ..n..pX...bG..F.
      0020: 66 0A BA 40 4D 69 32 60   AD 97 E2 20 4F F0 19 5C  f..@Mi2`... O..
      0030: D0 F5 36 B9 F4 A7 AD FE   C7 9C 83 64 74 BA 73 5C  ..6........dt.s
      0040: D1 01 08 B5 B4 88 98 D4   71 51 D0 A8 00 1E 00 04  ........qQ......
      0050: 00 05 00 2F 00 33 00 32   00 0A 00 16 00 13 00 09  .../.3.2........
      0060: 00 15 00 12 00 03 00 08   00 14 00 11 01 00        ..............
      [Raw read]: length = 5
      0000: 16 03 01 00 4A                                     ....J
      [Raw read]: length = 74
      0000: 02 00 00 46 03 01 4F F0   19 5C E3 AE A8 26 DF 91  ...F..O.....&..
      0010: D2 6F 29 26 F5 FA EC 94   58 BE 2B C3 AE B3 13 4E  .o)&....X.+....N
      0020: 4B 5F 3D 82 D9 30 20 4F   F0 19 5C D0 F5 36 B9 F4  K_=..0 O....6..
      0030: A7 AD FE C7 9C 83 64 74   BA 73 5C D1 01 08 B5 B4  ......dt.s.....
      0040: 88 98 D4 71 51 D0 A8 00   04 00                    ...qQ.....
      Remoting "config-based-ejb-client-endpoint" write-1, READ: TLSv1 Handshake, length = 74
      *** ServerHello, TLSv1
      RandomCookie:  GMT: 1324357980 bytes = { 227, 174, 168, 38, 223, 145, 210, 111, 41, 38, 245, 250, 236, 148, 88, 190, 43, 195, 174, 179, 19, 78, 75, 95, 61, 130, 217, 48 }
      Session ID:  {79, 240, 25, 92, 208, 245, 54, 185, 244, 167, 173, 254, 199, 156, 131, 100, 116, 186, 115, 92, 209, 1, 8, 181, 180, 136, 152, 212, 113, 81, 208, 168}
      Cipher Suite: SSL_RSA_WITH_RC4_128_MD5
      Compression Method: 0
      ***
      CONNECTION KEYGEN:
      Client Nonce:
      0000: 4F F0 19 5C 82 BC CD 6E   8C 15 70 58 D3 81 D1 62  O.....n..pX...b
      0010: 47 81 CF 46 A8 66 0A BA   40 4D 69 32 60 AD 97 E2  G..F.f..@Mi2`...
      Server Nonce:
      0000: 4F F0 19 5C E3 AE A8 26   DF 91 D2 6F 29 26 F5 FA  O.....&...o)&..
      0010: EC 94 58 BE 2B C3 AE B3   13 4E 4B 5F 3D 82 D9 30  ..X.+....NK_=..0
      Master Secret:
      0000: 35 92 7D A3 EE 1F BB 07   76 8A FF 49 52 F9 0D 6E  5.......v..IR..n
      0010: D6 03 08 2C D3 1D F8 4B   E5 A8 1A 22 FA 20 A0 56  ...,...K...". .V
      0020: 69 18 08 57 99 A0 8B 9F   CA 32 1A 09 9D E9 49 BA  i..W.....2....I.
      Client MAC write Secret:
      0000: 88 A4 AF 0D DE 12 24 F9   56 FE 54 B5 0D 29 35 96  ......$.V.T..)5.
      Server MAC write Secret:
      0000: 3E 4C 99 6E 80 54 11 73   EA 36 0E 20 9F 51 75 FE  >L.n.T.s.6. .Qu.
      Client write key:
      0000: FD 0D DE 0D 47 15 A1 25   33 CB 01 F4 FA F5 D9 36  ....G..%3......6
      Server write key:
      0000: 5B 25 61 41 A1 18 73 52   A3 4D 24 97 11 DC 46 DB  [%aA..sR.M$...F.
      ... no IV used for this cipher
      %% Server resumed [Session-1, SSL_RSA_WITH_RC4_128_MD5]
      [read] MD5 and SHA1 hashes:  len = 74
      0000: 02 00 00 46 03 01 4F F0   19 5C E3 AE A8 26 DF 91  ...F..O.....&..
      0010: D2 6F 29 26 F5 FA EC 94   58 BE 2B C3 AE B3 13 4E  .o)&....X.+....N
      0020: 4B 5F 3D 82 D9 30 20 4F   F0 19 5C D0 F5 36 B9 F4  K_=..0 O....6..
      0030: A7 AD FE C7 9C 83 64 74   BA 73 5C D1 01 08 B5 B4  ......dt.s.....
      0040: 88 98 D4 71 51 D0 A8 00   04 00                    ...qQ.....
      [Raw read]: length = 5
      0000: 14 03 01 00 01                                     .....
      [Raw read]: length = 1
      0000: 01                                                 .
      Remoting "config-based-ejb-client-endpoint" read-1, READ: TLSv1 Change Cipher Spec, length = 1
      [Raw read]: length = 5
      0000: 16 03 01 00 20                                     .... 
      [Raw read]: length = 32
      0000: CB 86 E3 2D 78 29 48 B5   DC E5 E2 C6 24 3C 01 0E  ...-x)H.....$<..
      0010: 8A 2C B4 B2 1B BD 93 F6   C3 ED AE 0C 3B 8D 16 40  .,..........;..@
      Remoting "config-based-ejb-client-endpoint" read-1, READ: TLSv1 Handshake, length = 32
      Padded plaintext after DECRYPTION:  len = 32
      0000: 14 00 00 0C A6 54 14 92   28 D8 C9 42 A0 DE 85 86  .....T..(..B....
      0010: CB D6 E6 65 17 C4 CE 01   7A 5D 8F 01 77 98 BD 79  ...e....z]..w..y
      *** Finished
      verify_data:  { 166, 84, 20, 146, 40, 216, 201, 66, 160, 222, 133, 134 }
      ***
      [read] MD5 and SHA1 hashes:  len = 16
      0000: 14 00 00 0C A6 54 14 92   28 D8 C9 42 A0 DE 85 86  .....T..(..B....
      Remoting "config-based-ejb-client-endpoint" read-1, WRITE: TLSv1 Change Cipher Spec, length = 1
      *** Finished
      verify_data:  { 117, 252, 119, 85, 231, 194, 129, 157, 212, 138, 87, 19 }
      ***
      [write] MD5 and SHA1 hashes:  len = 16
      0000: 14 00 00 0C 75 FC 77 55   E7 C2 81 9D D4 8A 57 13  ....u.wU......W.
      Padded plaintext before ENCRYPTION:  len = 32
      0000: 14 00 00 0C 75 FC 77 55   E7 C2 81 9D D4 8A 57 13  ....u.wU......W.
      0010: 6F CD B0 E6 95 CC 44 F9   57 C9 8F FC 1B 5D CA B8  o.....D.W....]..
      Remoting "config-based-ejb-client-endpoint" read-1, WRITE: TLSv1 Handshake, length = 32
      [Raw write]: length = 6
      0000: 14 03 01 00 01 01                                  ......
      [Raw write]: length = 37
      0000: 16 03 01 00 20 27 82 C7   5C C8 10 23 18 69 25 7A  .... '....#.i%z
      0010: 9C DB C1 7B A1 9F E7 57   25 DC 19 96 77 AD BA BB  .......W%...w...
      0020: A3 77 FB B5 23                                     .w..#
      Padded plaintext before ENCRYPTION:  len = 58
      0000: 00 00 00 26 01 00 01 01   03 20 63 6F 6E 66 69 67  ...&..... config
      0010: 2D 62 61 73 65 64 2D 65   6A 62 2D 63 6C 69 65 6E  -based-ejb-clien
      0020: 74 2D 65 6E 64 70 6F 69   6E 74 F4 3D E2 3A 6C E1  t-endpoint.=.:l.
      0030: 01 AE AF 29 6B 7B 4F 6A   8F 21                    ...)k.Oj.!
      Remoting "config-based-ejb-client-endpoint" write-1, WRITE: TLSv1 Application Data, length = 42
      [Raw write (bb)]: length = 63
      0000: 17 03 01 00 3A 32 64 61   53 71 1E C4 34 DB 3F C8  ....:2daSq..4.?.
      0010: 4A 06 04 4D 1D BC 45 6F   22 49 58 C0 37 57 84 DD  J..M..Eo"IX.7W..
      0020: 17 ED 6D 2B A1 70 66 53   5C 34 A5 C0 A8 83 00 CA  ..m+.pfS4......
      0030: EF F3 E2 B5 00 11 44 36   93 2E 16 9C 3A 58 4A     ......D6....:XJ
      [Raw read (bb)]: length = 65
      0000: 17 03 01 00 3C 64 50 68   29 8E 9B 76 65 5F 82 92  ....<dPh)..ve_..
      0010: 17 9D CE 0D 34 14 15 CA   0B 06 C3 9E E4 28 68 31  ....4........(h1
      0020: 03 D8 16 63 86 F4 A9 B1   D0 FD 4F 48 8D AB D6 BD  ...c......OH....
      0030: 4D C5 DA 60 12 FD 04 97   A2 63 D0 90 12 13 65 34  M..`.....c....e4
      0040: AD                                                 .
      Padded plaintext after DECRYPTION:  len = 60
      0000: 00 00 00 28 01 00 01 01   03 09 6C 6F 63 61 6C 68  ...(......localh
      0010: 6F 73 74 01 10 4A 42 4F   53 53 2D 4C 4F 43 41 4C  ost..JBOSS-LOCAL
      0020: 2D 55 53 45 52 01 05 50   4C 41 49 4E F0 EA 13 28  -USER..PLAIN...(
      0030: C3 98 14 5F 2C C8 8C F7   35 7B B8 60              ..._,...5..`
      Jul 1, 2012 3:03:16 PM org.jboss.remoting3.remote.RemoteConnection handleException
      ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Cannot get userid/password [Caused by javax.security.auth.callback.UnsupportedCallbackException]
      Remoting "config-based-ejb-client-endpoint" read-1, called closeInbound()
      Remoting "config-based-ejb-client-endpoint" read-1, fatal error: 80: Inbound closed before receiving peer's close_notify: possible truncation attack?
      javax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack?
      %% Invalidated:  [Session-1, SSL_RSA_WITH_RC4_128_MD5]
      Remoting "config-based-ejb-client-endpoint" read-1, SEND TLSv1 ALERT:  fatal, description = internal_error
      Padded plaintext before ENCRYPTION:  len = 18
      0000: 02 50 A8 09 37 E3 6B D0   95 39 50 3B 5E A8 95 FD  .P..7.k..9P;^...
      0010: 09 6D                                              .m
      Remoting "config-based-ejb-client-endpoint" read-1, WRITE: TLSv1 Alert, length = 18
      Padded plaintext before ENCRYPTION:  len = 57
      0000: 00 00 00 25 10 BD B6 21   6F 01 09 6A 62 6F 73 73  ...%...!o..jboss
      0010: 2E 65 6A 62 80 04 00 00   40 00 81 02 00 50 82 04  .ejb....@....P..
      0020: 7F FF FF FF 83 02 FF FF   00 FA 9E 75 C7 C5 02 96  ...........u....
      0030: BA F6 8D 4D 82 0F E2 33   34                       ...M...34
      main, WRITE: TLSv1 Application Data, length = 41
      [Raw write (bb)]: length = 62
      0000: 17 03 01 00 39 65 24 10   57 64 42 BB 44 00 AF 82  ....9e$.WdB.D...
      0010: 70 CE B7 9B 90 38 72 A5   6F D4 7A 5E BC 28 1B FC  p....8r.o.z^.(..
      0020: CE 88 FF C4 DA 25 7E 40   75 CA 10 EF BC 29 06 AC  .....%.@u....)..
      0030: 42 8E B0 52 15 E7 DF 0E   EE E7 1E 17 E5 19        B..R..........
      [Raw read (bb)]: length = 41
      0000: 17 03 01 00 24 C4 BF BF   15 67 2E C4 F6 D1 F2 3E  ....$....g.....>
      0010: 22 D5 9F 0D 8A 5F B5 E9   2D 0D AB CC 9A 03 C8 0F  "...._..-.......
      0020: 75 A6 D6 51 31 8C AD FD   9E                       u..Q1....
      Padded plaintext after DECRYPTION:  len = 36
      0000: 00 00 00 10 11 3D B6 21   6F 80 04 00 00 40 00 81  .....=.!o....@..
      0010: 02 00 50 00 F0 4C 13 50   F7 6C 9D D4 43 6F BF 1B  ..P..L.P.l..Co..
      0020: 2A 34 0E 36                                        *4.6
      [Raw read (bb)]: length = 42
      0000: 17 03 01 00 25 CF 0E 4D   E1 2F DD 8F 6A 47 87 F1  ....%..M./..jG..
      0010: DC 75 68 78 C1 93 29 A7   B2 45 10 E9 01 1E B5 3B  .uhx..)..E.....;
      0020: 53 F1 81 DC 41 32 EC E4   55 21                    S...A2..U!
      Padded plaintext after DECRYPTION:  len = 37
      0000: 00 00 00 11 30 3D B6 21   6F 93 64 02 01 01 00 05  ....0=.!o.d.....
      0010: 72 69 76 65 72 B7 8A 2F   AA 47 B8 2C 0B 61 8C 40  river../.G.,.a.@
      0020: DB A4 B7 72 90                                     ...r.
      [Raw read (bb)]: length = 33
      0000: 17 03 01 00 1C A2 36 DA   89 9A 66 06 CB 44 CE 99  ......6...f..D..
      0010: 77 C4 05 3A 61 A5 8F EC   CA F6 73 C9 08 DC 2A 30  w..:a.....s...*0
      0020: FF                                                 .
      Padded plaintext after DECRYPTION:  len = 28
      0000: 00 00 00 08 30 3D B6 21   6F 93 64 01 E0 96 EB B5  ....0=.!o.d.....
      0010: B6 F5 7C ED 94 54 93 38   06 97 5C 0E              .....T.8...
      Padded plaintext before ENCRYPTION:  len = 31
      0000: 00 00 00 0B 31 BD B6 21   6F 93 64 00 00 00 11 3B  ....1..!o.d....;
      0010: B4 B4 47 F1 D2 C5 33 AC   42 B2 9F 6F F8 B7 70     ..G...3.B..o..p
      Remoting "config-based-naming-client-endpoint" task-3, WRITE: TLSv1 Application Data, length = 15
      [Raw write (bb)]: length = 36
      0000: 17 03 01 00 1F 8B 71 8F   FA 1C FC AC C4 7B D7 CF  ......q.........
      0010: 23 92 CB 64 C7 B9 15 9A   B0 EF 7E 13 4A 73 FE A1  #..d........Js..
      0020: DA BD 0D 55                                        ...U
      Padded plaintext before ENCRYPTION:  len = 36
      0000: 00 00 00 10 30 BD B6 21   6F 68 A2 02 01 00 05 72  ....0..!oh.....r
      0010: 69 76 65 72 AC C6 BF FE   A2 FC 7F 7E 95 5E 08 80  iver.........^..
      0020: 5D B5 5B 75                                        ].[u
      Remoting "config-based-naming-client-endpoint" task-3, WRITE: TLSv1 Application Data, length = 20
      [Raw write (bb)]: length = 41
      0000: 17 03 01 00 24 EE 99 F6   8E 1E ED 1B B3 30 92 6C  ....$........0.l
      0010: B5 AF 21 7E 41 38 4A 87   78 43 7A 65 A4 D6 CD 21  ..!.A8J.xCze...!
      0020: D4 01 51 57 97 35 50 61   B3                       ..QW.5Pa.
      [Raw read (bb)]: length = 36
      0000: 17 03 01 00 1F 85 30 13   2D A8 38 28 34 DE 8B 7A  ......0.-.8(4..z
      0010: DB 15 26 33 44 A4 87 BB   FB 0C 30 D8 C8 75 0E 32  ..&3D.....0..u.2
      0020: 00 D2 17 3C                                        ...<
      Padded plaintext after DECRYPTION:  len = 31
      0000: 00 00 00 0B 31 3D B6 21   6F 68 A2 00 00 00 10 03  ....1=.!oh......
      0010: BC 8F 14 E1 B5 DE BB BD   BC 58 70 80 BC 0D 3B     .........Xp...;
      Padded plaintext before ENCRYPTION:  len = 28
      0000: 00 00 00 08 30 BD B6 21   6F 68 A2 01 1D BF 50 2A  ....0..!oh....P*
      0010: 81 79 C9 0E 69 E0 14 D2   EF 6E 0C 4D              .y..i....n.M
      Remoting "config-based-naming-client-endpoint" task-3, WRITE: TLSv1 Application Data, length = 12
      [Raw write (bb)]: length = 33
      0000: 17 03 01 00 1C 08 ED 9C   D1 93 8F B2 D5 35 68 57  .............5hW
      0010: E3 29 F2 F8 46 9E 9A 0E   AB D0 3D 66 76 17 1A E9  .)..F.....=fv...
      0020: 6A                                                 j
      [Raw read (bb)]: length = 219
      0000: 17 03 01 00 D6 24 6F D6   81 4E F9 CC F9 F2 09 DF  .....$o..N......
      0010: 70 52 CD 12 19 BE DB 6C   99 DD 4D 65 BD 5A 29 B7  pR.....l..Me.Z).
      0020: DB DE BF 27 F5 09 1A 0C   ED D4 D1 E7 C5 64 01 F5  ...'.........d..
      0030: 33 B1 06 DD A0 47 88 1F   CC 66 12 12 47 BA 87 B0  3....G...f..G...
      0040: E5 0A D2 27 E4 5A 03 99   EE 79 BB 29 68 AE C6 46  ...'.Z...y.)h..F
      0050: 6F 9C 32 F8 03 6F FB 42   B7 88 EE 33 2E 06 1E 29  o.2..o.B...3...)
      0060: 98 AC 2F C2 13 61 9D F8   79 0C 72 ED 8D 71 6B 5D  ../..a..y.r..qk]
      0070: 46 15 C7 2F F8 E0 F3 54   A4 AD 74 A8 21 02 E1 CB  F../...T..t.!...
      0080: 6B 44 E4 E4 01 6B ED DA   18 E9 EE 3C E7 2A B3 04  kD...k.....<.*..
      0090: 37 1F 87 E5 84 35 4E 70   84 74 F5 F9 11 D3 B9 80  7....5Np.t......
      00A0: DD EA CD 18 A0 19 D5 E7   D4 59 1C 07 EE C8 81 7D  .........Y......
      00B0: 21 A1 91 48 5D B0 D4 2E   21 74 28 0E E4 F3 4C F6  !..H]...!t(...L.
      00C0: 86 FB A1 DF 7B 38 86 85   24 91 13 33 94 29 D5 A0  .....8..$..3.)..
      00D0: EA DE 9B AB 24 33 6F 5D   A4 D7 B5                 ....$3o]...
      Padded plaintext after DECRYPTION:  len = 214
      0000: 00 00 00 C2 30 3D B6 21   6F 68 4E 02 08 06 00 00  ....0=.!ohN.....
      0010: 00 19 4A 50 41 5F 57 69   74 68 5F 4A 41 58 52 53  ..JPA_With_JAXRS
      0020: 5F 42 41 53 49 43 5F 44   65 6D 6F 00 00 00 00 00  _BASIC_Demo.....
      0030: 17 41 70 70 6C 69 63 61   74 69 6F 6E 4C 65 76 65  .ApplicationLeve
      0040: 6C 4A 4D 53 44 65 6D 6F   00 00 00 06 6A 73 72 2D  lJMSDemo....jsr-
      0050: 37 37 00 06 6A 73 72 2D   37 37 00 00 00 10 54 65  77..jsr-77....Te
      0060: 73 74 52 65 6D 6F 74 65   45 4A 42 45 41 52 00 10  stRemoteEJBEAR..
      0070: 54 65 73 74 52 65 6D 6F   74 65 45 4A 42 45 41 52  TestRemoteEJBEAR
      0080: 00 00 00 10 54 65 73 74   52 65 6D 6F 74 65 45 4A  ....TestRemoteEJ
      0090: 42 45 41 52 00 09 72 65   6D 6F 74 65 45 4A 42 00  BEAR..remoteEJB.
      00A0: 00 00 00 00 1F 6D 79 73   71 6C 2D 63 6F 6E 6E 65  .....mysql-conne
      00B0: 63 74 6F 72 2D 6A 61 76   61 2D 35 2E 31 2E 31 33  ctor-java-5.1.13
      00C0: 2D 62 69 6E 00 00 E7 3A   39 59 F9 59 6C 75 B4 D9  -bin...:9Y.Ylu..
      00D0: 0A 9D EA 59 E3 40                                  ...Y.@
      [Raw read (bb)]: length = 33
      0000: 17 03 01 00 1C 83 19 A5   9A 47 E6 B6 2B 8B 70 AB  .........G..+.p.
      0010: DF BF 50 92 1D 7C 43 C4   BA E2 B3 F1 EC FD 98 54  ..P...C........T
      0020: 66                                                 f
      Padded plaintext after DECRYPTION:  len = 28
      0000: 00 00 00 08 30 3D B6 21   6F 68 4E 01 D0 8E E4 B2  ....0=.!ohN.....
      0010: BC 45 6B FA 6B 01 C1 5C   BE 08 FF 52              .Ek.k.....R
      [Raw read (bb)]: length = 33
      0000: 17 03 01 00 1C 12 20 03   68 C3 9E 74 07 1B BA 21  ...... .h..t...!
      0010: 06 AE 3F C7 EB 38 9B E8   5D 09 8D AB 4E 13 21 09  ..?..8..]...N.!.
      0020: E8                                                 .
      Padded plaintext after DECRYPTION:  len = 28
      0000: 00 00 00 08 30 3D B6 21   6F 33 AA 02 4F 99 C5 C4  ....0=.!o3..O...
      0010: AC D5 C9 16 51 2E 1D 61   6A 97 30 CB              ....Q..aj.0.
      [Raw read (bb)]: length = 33
      0000: 17 03 01 00 1C 70 6A E2   C8 13 80 34 D4 A6 DD 84  .....pj....4....
      0010: FD 4D F8 42 50 AE 61 6D   5B B5 1D 23 DA 2B E7 B1  .M.BP.am[..#.+..
      0020: BE                                                 .
      Padded plaintext after DECRYPTION:  len = 28
      0000: 00 00 00 08 30 3D B6 21   6F 33 AA 01 1D 07 77 8D  ....0=.!o3....w.
      0010: 75 A8 BC 66 A0 5A AB EA   BA 8C 72 BF              u..f.Z....r.
      Padded plaintext before ENCRYPTION:  len = 31
      0000: 00 00 00 0B 31 BD B6 21   6F 68 4E 00 00 00 C2 31  ....1..!ohN....1
      0010: 35 7D 34 B2 0D A9 28 8F   DF 5F D1 41 A4 51 27     5.4...(.._.A.Q'
      Remoting "config-based-naming-client-endpoint" task-4, WRITE: TLSv1 Application Data, length = 15
      [Raw write (bb)]: length = 36
      0000: 17 03 01 00 1F CA E5 C2   92 8F D3 05 0B 0B 67 20  ..............g 
      0010: 75 6E D1 91 F3 59 EA F0   90 32 87 6E FD 94 9D E1  un...Y...2.n....
      0020: 15 F9 82 0A                                        ....
      Padded plaintext before ENCRYPTION:  len = 27
      0000: 00 00 00 07 32 BD B6 21   6F 68 4E 0D 41 22 CB 26  ....2..!ohN.A".&
      0010: 67 1F D6 72 AC 68 B3 04   35 16 56                 g..r.h..5.V
      Remoting "config-based-naming-client-endpoint" task-4, WRITE: TLSv1 Application Data, length = 11
      [Raw write (bb)]: length = 32
      0000: 17 03 01 00 1B 66 A4 F8   9F 70 A5 35 8F 31 6E CE  .....f...p.5.1n.
      0010: D8 4D F4 23 81 48 B6 73   E0 0E 55 F4 91 8D 8A 93  .M.#.H.s..U.....


      
      	--------------------------
      Got initial Context: javax.naming.InitialContext@214a7a12



      Padded plaintext before ENCRYPTION:  len = 149
      0000: 00 00 00 81 30 89 FB 8F   55 C6 F2 02 01 00 00 00  ....0...U.......
      0010: 01 02 00 04 38 00 00 00   1A 6A 61 76 61 78 2E 6E  ....8....javax.n
      0020: 61 6D 69 6E 67 2E 43 6F   6D 70 6F 73 69 74 65 4E  aming.CompositeN
      0030: 61 6D 65 17 25 1A 4B 93   D6 7A FE 00 00 00 00 16  ame.%.K..z......
      0040: 32 04 00 00 00 04 3E 10   54 65 73 74 52 65 6D 6F  2.....>.TestRemo
      0050: 74 65 45 4A 42 45 41 52   3E 09 72 65 6D 6F 74 65  teEJBEAR>.remote
      0060: 45 4A 42 3D 3E 1E 43 61   6C 6C 65 72 42 65 61 6E  EJB=>.CallerBean
      0070: 21 72 65 6D 6F 74 65 2E   43 61 6C 6C 65 72 52 65  !remote.CallerRe
      0080: 6D 6F 74 65 35 B7 90 36   A1 60 3E 4B 30 5B 74 7E  mote5..6.`>K0[t.
      0090: 6D 2E 61 1E E4                                     m.a..
      main, WRITE: TLSv1 Application Data, length = 133
      [Raw write (bb)]: length = 154
      0000: 17 03 01 00 95 44 79 98   7B 5F 40 57 7D 86 DA B7  .....Dy.._@W....
      0010: 83 E9 68 C4 C2 DA 13 30   07 06 1B DA 55 2E E9 2E  ..h....0....U...
      0020: 17 69 00 F2 E7 27 3B B0   6D 0B 06 A7 3A 19 12 32  .i...';.m...:..2
      0030: 26 EF 9E 20 5D 7C 85 47   7C 1E E8 D3 F5 35 45 68  &.. ]..G.....5Eh
      0040: D1 D6 72 E0 D3 83 C2 CA   AD C9 5E 3B 48 26 BE C3  ..r.......^;H&..
      0050: B3 70 62 3E 78 A9 C1 D9   2B 63 0E 9D BE F2 1C 4D  .pb>x...+c.....M
      0060: 0C DE 29 33 31 59 B5 47   99 F2 FB A7 31 18 97 74  ..)31Y.G....1..t
      0070: A8 D4 CD B4 15 E3 99 BA   E3 57 42 C0 D7 81 96 D4  .........WB.....
      0080: CF EF 33 3B EF 77 2F BA   C3 9B 3B 8E E0 9F 2B 92  ..3;.w/...;...+.
      0090: 43 8C 65 4D 15 63 5F DF   87 60                    C.eM.c_..`
      Padded plaintext before ENCRYPTION:  len = 28
      0000: 00 00 00 08 30 89 FB 8F   55 C6 F2 01 DD 66 08 5B  ....0...U....f.[
      0010: 62 AA 8D CD 24 1D DB BE   74 55 D4 93              b...$...tU..
      main, WRITE: TLSv1 Application Data, length = 12
      [Raw write (bb)]: length = 33
      0000: 17 03 01 00 1C 46 59 2C   19 D8 EF F1 49 E1 45 23  .....FY,....I.E#
      0010: B6 AB 60 BB F6 77 10 AF   82 57 5C F5 AD C4 00 E8  ..`..w...W.....
      0020: 83                                                 .
      [Raw read (bb)]: length = 36
      0000: 17 03 01 00 1F F5 D3 5D   94 7C 7C 73 8B E1 6C 7C  .......]...s..l.
      0010: AE AE 6E FB 1C 88 91 06   AB DC 25 E5 BA 53 AA 05  ..n.......%..S..
      0020: CA 29 09 C4                                        .)..
      Padded plaintext after DECRYPTION:  len = 31
      0000: 00 00 00 0B 31 09 FB 8F   55 C6 F2 00 00 00 81 ED  ....1...U.......
      0010: E4 16 A1 5E CD 6D 16 1D   85 71 37 BC 97 C8 F7     ...^.m...q7....
      [Raw read (bb)]: length = 506
      0000: 17 03 01 01 F5 26 C1 8C   8A EF 94 85 F0 30 2E 14  .....&.......0..
      0010: 55 3D D8 2E D3 8E CB 70   49 5F 2B 94 49 47 6D 6D  U=.....pI_+.IGmm
      0020: 70 95 9B CB F8 88 00 37   60 CD B6 35 1F 5B 34 6D  p......7`..5.[4m
      0030: 80 3C 52 32 60 92 49 CD   B5 FB 0E 31 06 12 10 42  .<R2`.I....1...B
      0040: F5 92 ED 89 B1 D7 F4 F6   16 52 0A 76 93 7D 23 4F  .........R.v..#O
      0050: 4D 42 A4 5D 0C 45 E2 97   24 FD A4 12 94 73 C1 17  MB.].E..$....s..
      0060: 55 2D CC 95 AC AB 8C 5F   83 9C 3D 64 51 7E 86 0F  U-....._..=dQ...
      0070: F8 CD 1D 3C 43 BA 43 AC   36 57 DD E4 E9 E1 6D D4  ...<C.C.6W....m.
      0080: 03 08 61 8D 9B F5 41 C2   DF 20 08 31 12 F9 63 36  ..a...A.. .1..c6
      0090: A5 D2 9D 8E B7 F9 A1 80   49 B8 54 CC F9 FA 70 DF  ........I.T...p.
      00A0: 36 19 E1 CE 5F 96 ED 90   CF 12 3A 51 7D 80 E8 E2  6..._.....:Q....
      00B0: CA 72 A5 3E 5A A2 25 D3   1C A8 85 A4 73 23 2C 6D  .r.>Z.%.....s#,m
      00C0: 1D AD 1D A2 6B CF 4B AB   1B 45 67 A1 48 4A 6D F0  ....k.K..Eg.HJm.
      00D0: 2A 13 5D 2B 9F 76 28 67   3C BC 23 3D A5 E4 E6 C9  *.]+.v(g<.#=....
      00E0: F2 DD 0F 65 92 F3 06 4E   C8 F8 C5 93 2E 9A 05 CB  ...e...N........
      00F0: 3A 61 68 D8 72 02 AE BD   3F 5F 43 02 CE 2D 91 23  :ah.r...?_C..-.#
      0100: 12 EE 36 E1 14 24 26 28   56 FD 3C 27 F5 47 FD B7  ..6..$&(V.<'.G..
      0110: 66 8A 08 A2 4B F3 31 C1   CE 00 CF F5 03 2E 21 1F  f...K.1.......!.
      0120: 9E 05 DF 75 61 29 7D 6F   19 7E 68 2B 12 A3 2E 31  ...ua).o..h+...1
      0130: A1 2B C3 C2 5C 32 38 46   03 4E 1D 0F 62 21 4B 3E  .+..28F.N..b!K>
      0140: 63 9C 40 F5 A9 41 B2 D6   45 D4 EA 82 F9 32 80 39  c.@..A..E....2.9
      0150: 26 05 57 61 A5 0C EF CF   D1 91 C8 6D A9 91 73 7B  &.Wa.......m..s.
      0160: F9 16 CD 04 D4 55 4C 7D   4C 26 DE 98 81 B8 ED AF  .....UL.L&......
      0170: C5 03 C9 00 82 B7 E9 3E   F9 AB 00 E4 3B 9A 8C F1  .......>....;...
      0180: DD 9F BE A0 86 DF 94 B9   6F 8F 45 41 68 E0 F0 11  ........o.EAh...
      0190: 18 7A AA 8F F1 07 7F 66   A5 01 3E 22 63 5C 19 2E  .z.....f..>"c..
      01A0: 66 0C BC 37 80 13 30 ED   94 32 35 A2 FA B5 A2 5C  f..7..0..25....
      01B0: 6D 12 F1 E4 E6 81 A5 73   0E 81 73 D5 8F 43 6B C6  m......s..s..Ck.
      01C0: 8C AF F5 A6 B2 48 92 60   4C 1F D3 88 B6 EF C7 FB  .....H.`L.......
      01D0: A1 92 FE 55 27 C4 35 CA   B6 B0 D2 A0 00 D8 2C 47  ...U'.5.......,G
      01E0: C7 3B D1 16 84 70 62 E8   C0 1B B7 64 DF 07 BE 20  .;...pb....d... 
      01F0: 95 03 4C DE 54 BF 36 5D   E9 59                    ..L.T.6].Y
      Padded plaintext after DECRYPTION:  len = 501
      0000: 00 00 01 E1 30 09 FB 8F   55 47 5C 02 01 00 00 00  ....0...UG.....
      0010: 01 00 01 02 04 08 00 00   00 01 00 00 00 13 72 65  ..............re
      0020: 6D 6F 74 65 2E 43 61 6C   6C 65 72 52 65 6D 6F 74  mote.CallerRemot
      0030: 65 04 0A 00 00 00 33 6F   72 67 2E 6A 62 6F 73 73  e.....3org.jboss
      0040: 2E 65 6A 62 2E 63 6C 69   65 6E 74 2E 53 65 72 69  .ejb.client.Seri
      0050: 61 6C 69 7A 65 64 45 4A   42 49 6E 76 6F 63 61 74  alizedEJBInvocat
      0060: 69 6F 6E 48 61 6E 64 6C   65 72 DF 1B 78 98 5F 16  ionHandler..x._.
      0070: BB E4 04 09 00 00 00 28   6F 72 67 2E 6A 62 6F 73  .......(org.jbos
      0080: 73 2E 65 6A 62 2E 63 6C   69 65 6E 74 2E 53 74 61  s.ejb.client.Sta
      0090: 74 65 6C 65 73 73 45 4A   42 4C 6F 63 61 74 6F 72  telessEJBLocator
      00A0: D5 CF 9C 76 5F F2 DB 52   00 00 00 00 09 00 00 00  ...v_..R........
      00B0: 1F 6F 72 67 2E 6A 62 6F   73 73 2E 65 6A 62 2E 63  .org.jboss.ejb.c
      00C0: 6C 69 65 6E 74 2E 45 4A   42 4C 6F 63 61 74 6F 72  lient.EJBLocator
      00D0: 9A 9A F5 E4 24 8F EC 1C   00 00 00 06 00 00 00 08  ....$...........
      00E0: 61 66 66 69 6E 69 74 79   09 00 00 00 1D 6F 72 67  affinity.....org
      00F0: 2E 6A 62 6F 73 73 2E 65   6A 62 2E 63 6C 69 65 6E  .jboss.ejb.clien
      0100: 74 2E 41 66 66 69 6E 69   74 79 D6 92 81 EA 9B 17  t.Affinity......
      0110: 7C F3 00 00 00 00 16 00   00 00 00 07 61 70 70 4E  ............appN
      0120: 61 6D 65 14 00 00 00 00   08 62 65 61 6E 4E 61 6D  ame......beanNam
      0130: 65 14 00 00 00 00 0C 64   69 73 74 69 6E 63 74 4E  e......distinctN
      0140: 61 6D 65 14 00 00 00 00   0A 6D 6F 64 75 6C 65 4E  ame......moduleN
      0150: 61 6D 65 14 00 00 00 00   08 76 69 65 77 54 79 70  ame......viewTyp
      0160: 65 15 00 16 04 09 00 00   00 28 6F 72 67 2E 6A 62  e........(org.jb
      0170: 6F 73 73 2E 65 6A 62 2E   63 6C 69 65 6E 74 2E 41  oss.ejb.client.A
      0180: 66 66 69 6E 69 74 79 24   4E 6F 41 66 66 69 6E 69  ffinity$NoAffini
      0190: 74 79 E3 83 D7 FB CD 1D   A3 64 00 00 00 00 3B FE  ty.......d....;.
      01A0: 3E 10 54 65 73 74 52 65   6D 6F 74 65 45 4A 42 45  >.TestRemoteEJBE
      01B0: 41 52 3E 0A 43 61 6C 6C   65 72 42 65 61 6E 3D 3E  AR>.CallerBean=>
      01C0: 09 72 65 6D 6F 74 65 45   4A 42 04 15 07 00 00 00  .remoteEJB......
      01D0: 13 72 65 6D 6F 74 65 2E   43 61 6C 6C 65 72 52 65  .remote.CallerRe
      01E0: 6D 6F 74 65 35 1C 38 19   31 AC D0 1E 09 22 D9 DE  mote5.8.1...."..
      01F0: 19 17 F3 64 9C                                     ...d.
      [Raw read (bb)]: length = 33
      0000: 17 03 01 00 1C 38 60 9F   87 E1 25 46 D1 5C FE 37  .....8`...%F..7
      0010: E0 A1 EF 65 C3 C9 2F 6A   D2 76 98 44 D4 DA 77 E1  ...e../j.v.D..w.
      0020: 4F                                                 O
      Padded plaintext after DECRYPTION:  len = 28
      0000: 00 00 00 08 30 09 FB 8F   55 47 5C 01 5B 9B 83 37  ....0...UG.[..7
      0010: 72 9F 11 14 92 D6 95 01   0F 5D D1 73              r........].s
      Padded plaintext before ENCRYPTION:  len = 31
      0000: 00 00 00 0B 31 89 FB 8F   55 47 5C 00 00 01 E1 43  ....1...UG....C
      0010: 02 71 58 93 8E BD D0 5A   DC 7C A8 51 48 70 6A     .qX....Z...QHpj
      naming-client-message-receiver-1-thread-1, WRITE: TLSv1 Application Data, length = 15
      [Raw write (bb)]: length = 36
      0000: 17 03 01 00 1F CB B0 45   F0 FE 66 22 CC 4F 4E 9B  .......E..f".ON.
      0010: 12 9F 40 F8 EA 07 BC B4   B4 9A 30 D1 71 93 F4 5E  ..@.......0.q..^
      0020: 05 9D 6F 3D                                        ..o=
      Padded plaintext before ENCRYPTION:  len = 163
      0000: 00 00 00 8F 30 BD B6 21   6F 8E E0 03 03 00 00 00  ....0..!o.......
      0010: 0A 74 65 73 74 4D 65 74   68 6F 64 00 10 6A 61 76  .testMethod..jav
      0020: 61 2E 6C 61 6E 67 2E 53   74 72 69 6E 67 02 3E 10  a.lang.String.>.
      0030: 54 65 73 74 52 65 6D 6F   74 65 45 4A 42 45 41 52  TestRemoteEJBEAR
      0040: 3E 09 72 65 6D 6F 74 65   45 4A 42 3D 3E 0A 43 61  >.remoteEJB=>.Ca
      0050: 6C 6C 65 72 42 65 61 6E   04 10 02 10 00 16 03 01  llerBean........
      0060: 39 FC 39 FE 3D 39 FD 04   15 07 00 00 00 13 72 65  9.9.=9........re
      0070: 6D 6F 74 65 2E 43 61 6C   6C 65 72 52 65 6D 6F 74  mote.CallerRemot
      0080: 65 3E 0F 4D 69 64 64 6C   65 77 61 72 65 4D 61 67  e>.MiddlewareMag
      0090: 69 63 00 49 9B 7E 78 77   8D 6C DA 1D 7E 38 1F 02  ic.I..xw.l...8..
      00A0: 71 79 6E                                           qyn
      main, WRITE: TLSv1 Application Data, length = 147
      [Raw write (bb)]: length = 168
      0000: 17 03 01 00 A3 B1 A6 99   93 12 98 81 2B E5 8E F7  ............+...
      0010: 94 2E E5 1A 89 B6 92 A4   2E 85 8C AA 92 DD 38 09  ..............8.
      0020: EF 06 EE 2F C2 97 57 DE   82 15 A8 6E DE 77 F1 F6  .../..W....n.w..
      0030: 2D 6D 71 1B D8 F1 65 F5   20 80 12 BA 4A D1 2E 74  -mq...e. ...J..t
      0040: 5F EB 2F 72 5D 4A 3B 49   67 C7 B4 1B F3 8E 3C 6F  _./r]J;Ig.....<o
      0050: D1 87 EF 65 3A 8B 14 E0   74 77 66 D6 20 0F 0E B4  ...e:...twf. ...
      0060: 2C 34 35 F6 AF 43 0F EB   44 4C FE 65 E7 21 85 F4  ,45..C..DL.e.!..
      0070: 92 3C DF 15 F3 7F 71 49   9C 5C 32 DC 0D 04 51 4B  .<....qI.2...QK
      0080: 90 83 5B 1C AD F8 8F A5   9D 89 5D 70 B8 BA FD 8D  ..[.......]p....
      0090: 5B 20 11 C1 F7 9E F5 E9   1F C3 C6 B1 E1 A3 68 87  [ ............h.
      00A0: 2B 12 F3 E1 40 28 D9 20                            +...@(. 
      [Raw read (bb)]: length = 36
      0000: 17 03 01 00 1F 4C F2 AD   06 0D 28 4A A0 86 A4 FE  .....L....(J....
      0010: 94 D8 0D 64 D0 06 F9 FC   E6 C3 22 2B 62 03 FC 9E  ...d......"+b...
      0020: 70 E0 1F E2                                        p...
      Padded plaintext after DECRYPTION:  len = 31
      0000: 00 00 00 0B 31 3D B6 21   6F 8E E0 00 00 00 8F CD  ....1=.!o.......
      0010: 05 3B 87 AD E1 47 09 86   EC 79 86 AF 4D 2A 6B     .;...G...y..M*k
      [Raw read (bb)]: length = 96
      0000: 17 03 01 00 5B A9 AC 91   5F 8B 52 95 60 B7 52 8D  ....[..._.R.`.R.
      0010: 60 F8 CD 2E 78 ED C3 12   BC 52 BB BA 48 27 0C A7  `...x....R..H'..
      0020: CE 7E 1A 02 C6 C2 C3 4D   70 B2 FF A2 63 7F DC B7  .......Mp...c...
      0030: 25 2C 55 E1 4B 73 3C 3F   EF 16 A5 E5 0B 8A 6A 65  %,U.Ks<?......je
      0040: 7C BA 37 E2 23 B2 4C 38   6F 2F 76 97 AE 6D DC D8  ..7.#.L8o/v..m..
      0050: 35 91 F4 9E C7 C2 99 B5   14 21 70 C2 E7 9D 7C 0D  5........!p.....
      Padded plaintext after DECRYPTION:  len = 91
      0000: 00 00 00 47 30 3D B6 21   6F 30 28 02 05 00 00 02  ...G0=.!o0(.....
      0010: 3E 38 5B 43 61 6C 6C 65   72 42 65 61 6E 5D 20 74  >8[CallerBean] t
      0020: 65 73 74 4D 65 74 68 6F   64 28 29 20 72 65 74 75  estMethod() retu
      0030: 72 6E 65 64 20 48 65 6C   6C 6F 20 4D 69 64 64 6C  rned Hello Middl
      0040: 65 77 61 72 65 4D 61 67   69 63 00 1F 6B D4 71 EA  ewareMagic..k.q.
      0050: 70 D3 E9 21 E4 9B B2 98   9D BD 50                 p..!......P
      [Raw read (bb)]: length = 33
      0000: 17 03 01 00 1C ED D6 DC   6B C7 7D 02 82 42 83 39  ........k....B.9
      0010: D7 B1 99 8F 33 6C B1 AE   42 6E 24 A0 C9 47 C8 36  ....3l..Bn$..G.6
      0020: 11                                                 .
      Padded plaintext after DECRYPTION:  len = 28
      0000: 00 00 00 08 30 3D B6 21   6F 30 28 01 05 E0 4B C3  ....0=.!o0(...K.
      0010: 02 B9 7C 9F 9E 49 57 B2   DF 53 C7 26              .....IW..S.&
      Padded plaintext before ENCRYPTION:  len = 31
      0000: 00 00 00 0B 31 BD B6 21   6F 30 28 00 00 00 47 17  ....1..!o0(...G.
      0010: 3C 86 72 1B F6 5B A4 85   77 F4 CD C7 7A F4 66     <.r..[..w...z.f
      main, WRITE: TLSv1 Application Data, length = 15
      [Raw write (bb)]: length = 36
      0000: 17 03 01 00 1F BC 11 5E   8B 5B 80 45 77 BA BA D8  .......^.[.Ew...
      0010: 00 B8 33 56 2A C9 7E 17   68 F3 93 0C 92 78 AE F5  ..3V*...h....x..
      0020: 2E 12 F2 35                                        ...5


      
      	 remote.testMethod("MiddlewareMagic") = [CallerBean] testMethod() returned Hello MiddlewareMagic




      Padded plaintext before ENCRYPTION:  len = 21
      0000: 00 00 00 01 FF 6E 9D 38   AE 68 B7 24 3D 4B EF F6  .....n.8.h.$=K..
      0010: 1C 60 6E 5A A1                                     .`nZ.
      Thread-1, WRITE: TLSv1 Application Data, length = 5
      [Raw write (bb)]: length = 26
      0000: 17 03 01 00 15 DD A3 60   0C F1 FF 4C 02 39 37 B2  .......`...L.97.
      0010: DC 02 35 54 C7 F1 5F 51   54 FA                    ..5T.._QT.
      Thread-1, called closeOutbound()
      Thread-1, closeOutboundInternal()
      Thread-1, SEND TLSv1 ALERT:  warning, description = close_notify
      Padded plaintext before ENCRYPTION:  len = 18
      0000: 01 00 BE E2 AF A9 25 00   1B E1 4D 5E 96 94 31 3E  ......%...M^..1>
      0010: D4 5D                                              .]
      Thread-1, WRITE: TLSv1 Alert, length = 18
      [Raw write]: length = 23
      0000: 15 03 01 00 12 41 91 C7   E8 FC ED 72 7A 48 3A 84  .....A.....rzH:.
      0010: C3 1F AD 31 0F 91 A4                               ...1...
      [Raw read (bb)]: length = 26
      0000: 17 03 01 00 15 00 6F 70   FC E5 99 D2 D3 A5 EB 12  ......op........
      0010: B3 D4 C6 9C F4 F7 DA 23   3F 68                    .......#?h
      Padded plaintext after DECRYPTION:  len = 21
      0000: 00 00 00 01 FF E5 6D 43   49 4B 74 D5 5E 90 8A 7A  ......mCIKt.^..z
      0010: D7 1B 0A 79 CB                                     ...y.
      [Raw read]: length = 5
      0000: 15 03 01 00 12                                     .....
      [Raw read]: length = 18
      0000: 82 B9 69 EA A4 F3 9C 6E   18 9E 5F D6 E5 99 08 00  ..i....n.._.....
      0010: 9D 4B                                              .K
      Remoting "config-based-naming-client-endpoint" read-1, READ: TLSv1 Alert, length = 18
      Padded plaintext after DECRYPTION:  len = 18
      0000: 01 00 88 AF 54 6A 19 F4   56 80 9B 0F 40 45 20 0C  ....Tj..V...@E .
      0010: 0F 6D                                              .m
      Remoting "config-based-naming-client-endpoint" read-1, RECV TLSv1 ALERT:  warning, close_notify
      Remoting "config-based-naming-client-endpoint" read-1, closeInboundInternal()
      Remoting "config-based-naming-client-endpoint" read-1, closeOutboundInternal()

BUILD SUCCESSFUL
Total time: 5 seconds

.
.
Thanks 🙂
Middleware Magic Team


Http to Https automatic redirection in JBoss AS7

Hi,

In this demonstration we will see how to create a simple keystore and based on this how to configure the HTTPs connector in JBoss AS7. Also in many production environments it is desired to redirect clients incoming HTTP requests to HTTPs automatically.

So here we will see how can be use the redirect port configuration in the http connector and what kind of information we need to provide inside the “web.xml” file of our web application where we want automatic HTTPs redirection feature to make all the client conversation with the server CONFIDENTIAL.

SSL Configuration on JBoss AS7

Step1). Create a simple SSL certificate keystore. We can use the “keytool” utility which comes by default with the JDK and present inside the “$JAVA_HOME/bin” directory. So before running the below command make sure that you have set the PATH to point to your JDK bin directory.

For Unix Based OS:
export PATH=/home/userone/jdk1.6.0_21/bin:$PATH

For Windows Based OS:
set PATH=C:/jdk1.6.0_21/bin;%PATH%

Step2). Run the following command to create a sample key store file with name “chap8.keystore”


 keytool -genkey -keystore chap8.keystore -storepass rmi+ssl -keypass rmi+ssl 
            -keyalg RSA -alias chapter8  -validity 3650 
            -dname "cn=chapter8 example,ou=admin book,dc=jboss,dc=org"

Step3). Now paste the generated “chap8.keystore” inside the “/home/userone/jboss-as-7.1.0.Beta1/standalone/configuration” directory and then edit the “standalone-full.xml” file present in the same directory. We will need to edit the “urn:jboss:domain:web:1.1” subsystem as following:

        <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host">
            <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="8443"/>

            <connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" enable-lookups="false" secure="true">
                <ssl name="ssl" 
                     key-alias="chapter8" 
                     password="rmi+ssl" 
                     certificate-key-file="../standalone/configuration/chap8.keystore" 
                     protocol="TLSv1" 
                     verify-client="false"/>
            </connector>
            <virtual-server name="default-host" enable-welcome-root="true">
                <alias name="localhost"/>
                <alias name="example.com"/>
            </virtual-server>
        </subsystem>

NOTE: We added the redirect-port=”8443″ inside the http connector as well as we added the “https” connector settings with the ssl informations.

Step4). Now restart the JBoss AS7 server from inside “/home/userone/jboss-as-7.1.0.Beta1//bin” directory as following:

[userone@localhost bin]$./standalone.sh -c standalone-full.xml

Writing Test WebApplication

Step5). For simple testing we will write a web application. So create a directory somewhere in your file system with name “/home/userone/SelfSigned_SSL_Demo” and then create another directory “src” inside “/home/userone/SelfSigned_SSL_Demo”.

Step6). place the following kind of simple “index.jsp” file inside “/home/userone/SelfSigned_SSL_Demo/src” directory:

<html>
  <head>
    <title>SSL Demo</title>
  </head>
  <body bgcolor=maroon text=white>
      <BR><BR><BR><BR><BR><BR>
      <center>
       <b>index.jsp executed successfully over HTTPS.</b>
      </center>
  </body>
</html>

Step7). Now we will write a “web.xml” file inside the “/home/userone/SelfSigned_SSL_Demo/src” directory, and in this file we will define the user-data-constraint as CONFIDENTIAL sothat clients request matching the url-pattern defined will be automatically be redirected to the redirect-port defined inside the “standalone-full.xml” file.

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <security-constraint>
         <web-resource-collection>
             <web-resource-name>HTTPs Test</web-resource-name>
             <url-pattern>/*</url-pattern>
         </web-resource-collection>
         <user-data-constraint>
             <transport-guarantee>CONFIDENTIAL</transport-guarantee>
         </user-data-constraint>
    </security-constraint>
</web-app>

Step8). To simply build and deploy the above web application we will write the following kind of “build.xml” file inside “/home/userone/SelfSigned_SSL_Demo” directory.

<project name="JBoss_Service" default="post-deploy">
<property name="jboss.home" value="/home/userone/jboss-as-7.1.0.Beta1" />
<property name="jboss.module.dir" value="${jboss.home}/modules" />
<property name="java.home.dir" value="/home/userone/MyJdks/jdk1.6.0_05" />
<property name="basedir" value="." />
<property name="war.exploaded.name" value="SelfSigned_HttpsTest" />
<property name="src.dir" value="src" />
<property name="output.dir" value="build" />
 
   <path id="jboss.classpath">
     <fileset dir="${jboss.module.dir}">
        <include name="**/*.jar"/>
     </fileset>  
   </path>

   <target name="init">
      <delete dir="${output.dir}" />
      <mkdir dir="${output.dir}" />
      <mkdir dir="${output.dir}/${war.exploaded.name}"/>
      <mkdir dir="${output.dir}/${war.exploaded.name}/WEB-INF"/>
   </target>
	 
   <target name="build" depends="init">
        <copy todir="${output.dir}/${war.exploaded.name}/WEB-INF">
	  <fileset dir="${basedir}/src">
	      <include name="web.xml"/>
	  </fileset>
	</copy>   
        <copy todir="${output.dir}/${war.exploaded.name}">
	  <fileset dir="${basedir}/src">
	      <include name="index.jsp"/>
	  </fileset>
	</copy>  
        <jar jarfile="${output.dir}/${war.exploaded.name}.war" basedir="${output.dir}/${war.exploaded.name}" compress="true" /> 
   </target>

        <target name="deploy" depends="build">
            <echo message="*******************  Deploying   *********************" />  
            <echo message="********** ${war.exploaded.name}.war to ${jboss.home}/standalone/deployments **********" />  
            <copy todir="${jboss.home}/standalone/deployments/">
                <fileset dir="${output.dir}/">
                  <include name="${war.exploaded.name}.war"/> 
                </fileset>
            </copy>
            <echo message="*******************  Deployed Successfully   *********************" />  
        </target>
  
        <target name="post-deploy" depends="deploy">
            <echo message="*******************  NOTE  *********************" />
            <echo message="***** You should be able to access your WSDL using Browser now *****" />
            <echo message="                http://localhost:8080/${war.exploaded.name}/index.jsp" />
            <echo message="You will notice that your URL is automactically changing to https"/>
            <echo message="https://localhost:8443/${war.exploaded.name}/index.jsp" />
        </target>  
</project>

Step9). Now before running your ANT script to build and deploy the above webapplication you should have the ANT as well as JAVA set in the $PATH variable of the Shell / command prompt as following:

For Unix Based OS:
export PATH=/home/userone/jdk1.6.0_21/bin:/home/userone/org.apache.ant_1.6.5/bin:$PATH

For Windows Based OS:
set PATH=C:/jdk1.6.0_21/bin;C:/org.apache.ant_1.6.5/bin;%PATH%

Step10). run the ant script “ant” to build and deploy the application on JBoss AS7.

[userone@localhost SelfSigned_SSL_Demo]$ ant
Buildfile: build.xml

init:
   [delete] Deleting directory /home/userone/SelfSigned_SSL_Demo/build
    [mkdir] Created dir: /home/userone/SelfSigned_SSL_Demo/build
    [mkdir] Created dir: /home/userone/SelfSigned_SSL_Demo/build/SelfSigned_HttpsTest
    [mkdir] Created dir: /home/userone/SelfSigned_SSL_Demo/build/SelfSigned_HttpsTest/WEB-INF

build:
     [copy] Copying 1 file to /home/userone/SelfSigned_SSL_Demo/build/SelfSigned_HttpsTest/WEB-INF
     [copy] Copying 1 file to /home/userone/SelfSigned_SSL_Demo/build/SelfSigned_HttpsTest
      [jar] Building jar: /home/userone/SelfSigned_SSL_Demo/build/SelfSigned_HttpsTest.war

deploy:
     [echo] *******************  Deploying   *********************
     [echo] ********** SelfSigned_HttpsTest.war to /home/userone/jboss-as-7.1.0.Beta1/standalone/deployments **********
     [copy] Copying 1 file to /home/userone/jboss-as-7.1.0.Beta1/standalone/deployments
     [echo] *******************  Deployed Successfully   *********************

post-deploy:
     [echo] *******************  NOTE  *********************
     [echo] ***** You should be able to access your WSDL using Browser now *****
     [echo]                 http://localhost:8080/SelfSigned_HttpsTest/index.jsp
     [echo] You will notice that your URL is automactically changing to https
     [echo] https://localhost:8443/SelfSigned_HttpsTest/index.jsp

BUILD SUCCESSFUL
Total time: 0 seconds

NOTE: Access the application with URL “http://localhost:8080/SelfSigned_HttpsTest/index.jsp” and you will notice that your URL is automatically chaged to ” https://localhost:8443/SelfSigned_HttpsTest/index.jsp”

.
.
Thanks
MiddlewareMagic Team


Copyright © 2010-2012 Middleware Magic. All rights reserved. |