Skip to content

Using Http Relay

December 2, 2008


            URL u = new URL(url);
            URLConnection uc = u.openConnection();
            uc.setRequestProperty("Connection", "close");
            r = new BufferedReader(new InputStreamReader(uc.getInputStream()));
            String line;
            StringBuffer buf = new StringBuffer();
            while ((line = r.readLine()) != null)
                buf.append(line + "n");
            return buf.toString();

On Connection Close

HTTP/1.1 defines the “close” connection option for the sender to signal that the connection will be closed after completion of the response. For example,

       Connection: close

in either the request or the response header fields indicates that the connection SHOULD NOT be considered `persistent’ (section 8.1) after the current request/response is complete.

HTTP/1.1 applications that do not support persistent connections MUST include the “close” connection option in every message.

So if you have a Https relay in between your application server and client in different layers then you need to import the certificate the the relay instead of the server and

Note that the certificate generated has used the HOST name instead of IP because what SSL handshake internally does is check that the url that it is accessing ( And the domain in that url ) is matching with the domain of the mentioned certificate that is in the path of the running web application.

Root certificate if used – need not import each machine specific certificate but even then the – host name of sending machine

JbossWS Web service – deployment with Http Relay

One is that you would need to modify the – URL to call – should point to Http Relay and the wsdl should have the proxy address. For this change the file jboss-beans.xml which is jbossws.sar in deploy folder.

Change the host, port, and shoudModifyflag to false and then you have the wsdl generated with updated proxy address.

We noticed 5 GET requests and failure in POST – because of unreachable host. So corrected above.On jboss-native-core.jar the class has ways of handling GET and POST methods.

Probable alternative was to use the HTTP proxy set up in java opts of application/client usage – and then send call. Not tested this though. [HttpClientInvoker proxy setup ]

Then tested it with wget

tcpdump -i eth0 host <<IP-ADRESS>>  -w  <<FILENAME>>
wget “url”
OR User wireshark  —-

Router issues?

If Unable to access the url – different WAN ? / Location: try the command



route print


tcpdump on the source and destination.

If the packet is not reaching – you can get the info from the above commands.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: