HTTP/HTTPS and Java

Why is the difference between the following classes? Why do different versions of these classes exist the way they do? (This question is based off of Sun's Java 1.3.1 release).
java.net.HttpURLConnection
<==>
sun.net.www.protocol.http.HttpURLConnection
sun.plugin.protocol.https.BrowserHttpsURLConnection
<==>
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection
I'm writing code that needs to make HTTPS connections (I am using JSSE for this). I can make HTTP connections just fine, but the 'connect' member variable in URLConnection always remains false when I attempt an HTTPS connection. I get no status codes or error messages, just a dead connection. In an effort to debug this, I figured I'd take a peek out the source to get a hint as to what was going wrong. Anyway, I found myself more confused looking at the source, because there are different versions of things in different places. This is what led me to the question above.
Anyway help or insight would be much appreciated. Thanks.
Jake

the command-line looks like:
/opt/third-party/pkg/java-1.3.1_SUN/bin/java -classpath /opt/quality-ass
urance/lib/jars.current/HTTPClient.jar:/opt/quality-assurance/lib/jars.current/antlr.jar:/opt/quality-assurance/lib/jars.current/frank.jar:/opt/quality-assurance/lib/jars.current/org.jar:/opt/third-party/pkg/junit-3.2/jars/junit.jar:/opt/third-party/pkg/openxml-1.2/lib/openxml-1.2.jar:/opt/app/oracle/product/8.1.6/jdbc/lib/classes111.zip:/opt/third-party/jars/jsse.jar:/opt/third-party/jars/jnet.jar:/opt/third-party/jars/jcert.jar -Djava.library.path=/opt/quality-assurance/lib/jars.current qa.TestServer.GenericServer
the starting point where we are concerned is the run method of the class HttpTask. also i don't include the implementations, but methods like createFullyQualifiedURL() and originalURL(), etc return strings like 'http://www.company.com/one/two/three.html' or 'https://www.company.com/one/two/three.html' and also 'http://www.company.com:80/one/two/three.html' and
'https://www.company.com:443/one/two/three.html' depending on the startup params...
i know the details are sparse, but hopefully you understand the context. also i can assume the ca side of things is working, because i can use my browser to access the site via https. the code i'm writing which is somewhat functioning as a web client cannot access the site via https however.
jake
public class HttpTask extends SubTask {
// snip ..
public ResultIf run() {
// If we have already fetched, return NoResult
if (this.statusCode() != -1) {
return new NoResult(this.parent());
// Initialize URL
this.createFullyQualifiedURL();
if (this.originalURL().length() == 0) {
return this.defaultErrorResult(new Error("Empty URL"));
try {
// setup connection
HttpURLConnection connection = null;
connection = setupConnection();
connection.connect();
Log.log().debug("HTTP", "Fetching " + this.originalURL());
// process page
processPage(connection);
if (statusCode >= 300 && statusCode < 400) {
handleRedirect(connection);
} catch (Exception e) {
System.err.println(e);
return new HttpResult(this, true, "");
public HttpURLConnection setupConnection() throws Exception {
java.net.HttpURLConnection.setFollowRedirects(false);
java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Pro\
vider());
java.lang.System.setProperty("java.protocol.handler.pkgs","com.sun.net.\
ssl.internal.www.protocol");
java.lang.System.setProperty("javax.net.debug", "ssl,handshake,data,tru\
stmanager");
HttpURLConnection connection = null;
URL tempURL = new URL(this.originalURL());
URLConnection uc = tempURL.openConnection();
connection = (HttpURLConnection) uc;
connection.setRequestProperty("User-Agent", "Frank/3.0");
// Deal w/ cookies:
this.setCookieForFetch(connection);
// FIX what should the behavior for this be?
// Send POST headers if any
if (this.method().startsWith("POST")) {
ResultIf result = this.doPost(connection);
// returns non-null only if error occurs.
if (result != null) {
return null;
return connection;
public void handleRedirect(HttpURLConnection connection) throws Exception {
while (statusCode >= 300 && statusCode < 400) {
// shouldn't need to handle this for POST case,
// some things may redirect on POST even though it's
// against the HTTP spec
if (method().equals("GETS") || method().equals("POSTS")) {
method("GETS");
} else {
method ("GET");
redirectURL = connection.getHeaderField("Location");
if (! redirectURL.startsWith("http")) {
if (method().equals("GETS") || method().equals("POSTS")) {
redirectURL = "https://" + this.baseURL() + ":" + myTask().variable("HTTPS_PORT") + redirectURL;
} else {
redirectURL = "http://" + this.baseURL() + ":" + myTask().variable("HTTP_PORT") + redirectURL;
this.originalURL(redirectURL);
connection = setupConnection();
connection.connect();
statusCode = connection.getResponseCode();
processPage(connection);
public void processPage(HttpURLConnection connection) throws Exception {
this.statusCode(connection.getResponseCode());
this.pageSize(connection.getContentLength());
if (this.getDynamicCookies()) {
String dCookies = getCookiesFromReply(connection);
Hashtable cookies = new Hashtable();
this.addCookiesFromString(cookies, dCookies);
// HACK: this is a quick tweak because I don't think
// it is a good thing to have for every fetch.
cookies.remove("path");
Hashtable dynamicCookies = Tool.cloneIt(this.dynamicCookies());
Tool.mergeHashes(dynamicCookies, cookies);
this.dynamicCookies(dynamicCookies);
// Get HTML if applicable
if (! this.method().equals("HEAD")) {
this.html(Tool.slurp(connection.getInputStream()));
// WARN: check to see if length is different from above pageSize
this.pageSize(html.length());
// snip...
}

Similar Messages

  • Doubts about HTTPS requests and Java proxy

    Hello,
    I need help about SSL connections and Java.
    I'm developing a HTTP/S proxy with Java. To test my proxy, I use Firefox. I configure the proxy option in the browser. The proxy works good with HTTP requests, but with HTTPS requests doesn't work and I don't know why.
    I explain the steps that I do for a HTTPS request:
    * The browser sends a CONNECT message to the proxy.
    I check that the proxy receives the CONNECT request correctly.
    * The proxy establish a secure connection with the content server.
    I use an SSLSocket to connect with my content server, and the SSL handshake is succesful.
    * The proxy sends a 200 HTTP response to the client:
    I send
    HTTP/1.0 200 Connection established[CRLF]
    [CRLF]
    to the application client (Firefox)
    * The proxy sends/receive data to/from Firefox/content server
    I have a Socket between Firefox and my proxy, and a SSLSocket between my proxy and my content server. I use two threads to communicate the client and the server.
    Java code:
    //Thead server-->proxy-->application(Firefox)
    ThreadComm tpa = new ThreadComm(bis_serverSSL, bos_app);
    //Thread application(Firefox)-->proxy-->server
    ThreadComm tap = new ThreadComm(bis_app, bos_serverSSL);
    The "tpa" thread reads from the SSLSocket between the proxy and the server and sends data to the Socket between the proxy and Firefox.
    The "tap" thread reads from the Socket between the proxy and Firefox and sends data to the SSLSocket between the proxy and the server.
    This is the class ThreadComm:
    public class ThreadComm extends Thread{
        private BufferedInputStream bis = null;
        private BufferedOutputStream bos = null;
        public ThreadComm(BufferedInputStream bis, BufferedOutputStream bos) {
            this.bis = bis;
            this.bos = bos;
        @Override
        public void run() {
            int b = -1;
            FileOutputStream fos = null;
              do {
                   try {
                        b = bis.read();
                        System.out.print((char) b);
                        fos.write(b);
                        bos.write(b);
                        bos.flush();
                   } catch (Exception ex) {
                        Logger.getLogger(ThreadAplicacionProxy.class.getName()).log(Level.SEVERE, null, ex);
                        //b=-1;
              } while (b != -1);
        }But this doesn't work and I don't know why.      
    I have an Apache server with the mod_ssl enabled as content server, I can send requests (with Firefox) to the port 80(HTTP request) and 443(HTTPS request) without use my proxy and it works. If I use my proxy, HTTP request works but with HTTPS request doesn't work, I look the log of Apache and I see:
    [Tue Apr 27 17:32:03 2010] [info] Initial (No.1) HTTPS request received for child 62 (server localhost:443)
    [Tue Apr 27 17:32:03 2010] [error] [client 127.0.0.1] Invalid method in request \x80\x7f\x01\x03\x01
    [Tue Apr 27 17:32:03 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue Apr 27 17:32:03 2010] [info] [client 127.0.0.1] Connection closed to child 62 with standard shutdown (server localhost:443)
    Why it say? Invalid method in request \x80\x7f\x01\x03\x01 , my proxy sends the data that the Firefox sends.
    I think than I have follow the explanations of [1] but doesn't work, I have problems in implementation in Java but I don't know where.
    I appreciate any suggestions.
    Thanks for your time.
    [1] http://www.web-cache.com/Writings/Internet-Drafts/draft-luotonen-web-proxy-tunneling-01.txt

    ejp, I have checked the socket between the proxy and server and ... You are right! , I was using the port 80 instead of the 443 (incredible mistake!, I'm sorry). I was convinced that I was using the port 443... Well, is a little step, but I still have not won the war :)
    If I see the log files of Apache, We can see that something goes wrong.
    localhost-access.log
    >
    127.0.0.1 - - [04/May/2010:17:44:48 +0200] "\x 80\x 7f\x01\x03\x01" 501 219
    >
    localhost-error.log
    >
    [Tue May 04 17:44:48 2010] [info] Initial (No.1) HTTPS request received for child 63 (server localhost:443)
    [Tue May 04 17:44:48 2010] [error] [client 127.0.0.1] Invalid method in request \x80\x7f\x01\x03\x01
    [Tue May 04 17:44:48 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue May 04 17:44:48 2010] [info] [client 127.0.0.1] Connection closed to child 63 with standard shutdown (server localhost:443)
    >
    I think that this happens because Apache receives the data without decrypt, this is the reason because in the log we can see the "Invalid method in request \x80\x7f\x01\x03\x01". This supposition is true?
    ejp, you say that the "Termination is quite tricky." I have changed my code following yours suggestions (using the join and the shutdownOutput) but the threads don't die.
    I explain you what I do:
    (in time 1)
    I launch the thread (threadFirefoxToApache) that reads data from Firefox and sends to Apache.
    I launch the thread (threadApacheToFirefox) that reads data from Apache and sends to Firefox.
    (in time 2)
    threadFirefoxToApache sends the firts data to the server.
    threadApacheToFirefox is waiting that the server says something.
    (in time 3)
    threadFirefoxToApache is waiting that Firefox says something.
    threadApacheToFirefox sends data to Firefox.
    (in time 4)
    threadFirefoxToApache is waiting that Firefox says something.
    threadApacheToFirefox is waiting that Firefox says something.
    and they are waiting... and never finish.
    In time 2, these first data are encrypted. The server receives these data and It doesn't understand. In time 3, the server sends a HTTP response "501 Method Not Implemented", here there is a problem because this data must be encrypt. According to the documentation that I read, the proxy cannot "understand" this data but I can "understand" this data. What's happen?
    Firefox encrypt the data and send to the proxy. This It's correct.
    The proxy encrypt the data another time, because I use the SSLSocket to send the data to the server. Then the server receives the data encrypted two times, when decrypt the data gets the data encrypted one time. And this is the reason why the server doesn't understand the data that sends Firefox. It's correct? May be.
    Then If I want that the server receives the data encrypted one time I need to use the socketToServer, It's correct?
    I will supposed that yes. If I use the socketToServer, the proxy doesn't understand nothing, because the data received from the socketToServer are encrypted (I only see simbols), but the Apache log says that there is a problem with the version? (If I use the socketToServer the threads die)
    >
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 read finished A
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 write change cipher spec A
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 write finished A
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 flush data
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1756): OpenSSL: Handshake: done
    [Tue May 04 19:55:42 2010] [info] Connection: Client IP: 127.0.0.1, Protocol: TLSv1, Cipher: RC4-MD5 (128/128 bits)
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1817): OpenSSL: read 5/5 bytes from BIO#29bd910 [mem: 29ea0a8] (BIO dump follows)
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1750): -------------------------------------------------------------------------
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1789): | 0000: 80 7f 01 03 .... |
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1793): | 0005 - <SPACES/NULS>
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1795): ------------------------------------------------------------------------
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue May 04 19:55:42 2010] [info] [client 127.0.0.1] SSL library error 1 reading data
    [Tue May 04 19:55:42 2010] [info] SSL Library Error: 336130315 error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue May 04 19:55:42 2010] [info] [client 127.0.0.1] Connection closed to child 63 with standard shutdown (server localhost:443)
    >
    What option is the correct? I need use the SSLSocketToServer or socketToServer to send/read the data to/from the server?. Use the SSLSocket has sense because the data travel in a secure socket, but use the Socket also has sense because the data are encrypted and they are protected by this encription. It's complicated...

  • Http Proxy and Java Web Start 1.4.2_08

    Hi All,
    I'm confused as to how Java Web Start is supposed to work with an HTTP proxy. I'm testing an application in an environment which has an http proxy.
    Our application starts successfully with Web Start but the application is failing to connect to URLs. I have dumped the properties right when the app starts and proxyHost, proxyPort, http.proxyHost, http.ProxyPort are all set correctly. But every attempt to connect to URLs timeout.
    Note that running under 1.5, I get the value of the
    javaplugin.proxy.config.list property and use it to set the properties http.proxyHost and http.proxyPort. Then I am able to connect successfully to the same URLs which failed in 1.4.2_08 ( also fails
    with 1.4.2_03).
    Can someone please help me understand what's wrong here?
    Many thanks,
    Jason

    Actually, what I observed, in 1.4.2_08, is that the https.proxy* properties are being set. The http.proxy* properties are not set.
    in 1.5.0_04 none of the properties are set except for
    javaplugin.proxy.config.list, which I use to set http.proxyHost and http.proxyPort.

  • HTTP Post and Java Stack

    Does the java stack need to be installed for ECC5 to send a message via HTTP?
    Edited by: Kim Holloway on Dec 16, 2010 10:55 PM

    ECC is can send the data through ABAP Stack , No java stack required.
    Regards,
    Ravi.

  • Front-end HTTP Server and Performance with .jspx pages?

    This is more of a general question that I'm looking for validation:
    If the majority of our website is implemented as .jspx pages, with very few straight HTML pages, is there benefit in deploying to an environment with a separate HTTP front-end web server and back-end Application server (java container)? For example, I'm deploying to Tomcat as both the HTTP server and Java Application server for the .jspx pages; is there a performance advantage in deploying to an Apache HTTP server with a connector to Tomcat if I'm primarily serving up .jspx pages? I'm not as familiar with Oracle AS architecture, so my question is primarily around Tomcat deployment.
    thanks

    This is more of a general question that I'm looking for validation:
    If the majority of our website is implemented as .jspx pages, with very few straight HTML pages, is there benefit in deploying to an environment with a separate HTTP front-end web server and back-end Application server (java container)? For example, I'm deploying to Tomcat as both the HTTP server and Java Application server for the .jspx pages; is there a performance advantage in deploying to an Apache HTTP server with a connector to Tomcat if I'm primarily serving up .jspx pages? I'm not as familiar with Oracle AS architecture, so my question is primarily around Tomcat deployment.
    thanks

  • ABAP and Java HTTP Port same - PI 7.1 EHP1

    Hi,
    I have installed PI 7.1 EHP1 system.
    I realize that both ABAP and Java HTTP Ports are same.
    Is there any official note reg this or any info from SAP on the change.
    icm/server_port_0 = PROT=HTTP,PORT=51500,TIMEOUT=60,PROCTIMEOUT=600
    icm/HTTP/j2ee_0   = PREFIX=/,HOST=localhost,CONN=0-500,PORT=5$$00
    Thanks,
    Tanuj

    Hi,
    >>I realize that both ABAP and Java HTTP Ports are same.
    the changed happened in 7.1 already as far as I remember
    but I don't think it's documented anywhere except maybe the installation guide
    Regards,
    Michal Krawczyk

  • HTTP Tunneling and Load Balancing with Weblogic Server 6.1

    We use T3 for Java client to application server communication (Weblogic Server
    6.1) and keep the session open for the life of the client. We many customers
    using this with load balancers and all works fine. We have just started to use
    BEA's HTTP tunneling and I have a question concerning how this will work with
    load balancers. Since the single T3 connection has been replaced with a series
    of stateless HTTP connections, does the BEA tunneling code put session information
    in the HTTP header? If so, what information does it place in the header. If
    it does we should be able to use that to make sure that the load balancer always
    sends HTTP requests with that session to the same application server.
    Thanks!
    Rick

    Rick,
    You may want to look at the Alteon and F5 configuration we have on edocs.
    Take a look at the following URLs for a possible solution
    http://edocs.bea.com/wls/docs61/cluster/alteon.html#591902
    http://edocs.bea.com/wls/docs61/cluster/bigip.html#591902
    Chuck Nelson
    DRE
    BEA Technical Support

  • HTTP BC and Attachments

    Hi,
    I am trying to consume a SOAP message with an MTOM attachment via the HTTP BC and then process the message in a service engine. However, when I inspect the message content in the MessageExchange received in the service engine, I see no attachment but instead the data of the attachment inlined as Base64 characters in a DOMSource. My expectation would have been that the BC puts the attachment to the NMR as a DataHandler and the message payload as a StaXSource. At least this is what happens using Metro in a Servlet based WebService. My understanding was that the HTTP BC uses Metro as well, doesn't it? BTW I am really missing documentation on using WSIT features with the HTTP BC ...
    Regards,
    Kai

    Hi Kai,
    Yes, your expectation is correct, but we currently don't support attachments in JBI message exchanges. So, for now, the attachments are inlined as you observed. We are looking into adding this support in the near future though.
    HTTP BC does use Metro as the underlying technology, so you should get all the WS-* features as in the EE web services. We just posted some documentation on how to configure WSIT options in HTTP BC. Here is the link to it:http://wiki.open-esb.java.net/Wiki.jsp?page=HTTPBCWSITConfiguration
    BTW, exposing WSIT feature through HTTP BC is still work in progress, so we are adding more documentation as we progress. The full set of support should be available very soon, and so you should be seeing more/better documentations on this.
    Thanks
    --Sherry                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • HTTP+FTP+HTTPS library for JAVA

    Looking for a free JAVA library (with source code) that can manage automatic HTTP, HTTPS and FTP downloads.
    Need a robust library with retry, scheduling, error report mechanism Please let me know
    Thanks in Advance..
    Regard's
    Roopesh

    Take a look at URLConnection and it's derived classes and if they do not do what you want then google for "Jakarta Commons Net" .

  • Mac OSX 10.9.4 coldfusion 11 standalone server ERROR: HTTP Status 500 - java.lang.NullPointerException

    Hi all.
    I have installed the cold fusion server.
    at first with mac server, apache..... but after install cold fusion and want to go to the admin page:
    HTTP Status 500 - java.lang.NullPointerException
    I deinstalled the server from mac and cold fusion..
    after a fresh install of coldfusion 11 and use the build in server..
    the same error..
    does anybody knows the problems?
    I Use Java 7 Update 67
    A friend of me have installed it .. it runs
    greetings thorsten

    Hi this is my cold fusion Error LOG
    java.lang.NullPointerException
      at coldfusion.CfmServlet.init(CfmServlet.java:97)
      at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:121)
      at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:59)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1279)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1192)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:864)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:134)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:104 0)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.jav a:607)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
    Sep 16, 2014 8:30:59 AM org.apache.catalina.core.ApplicationContext log
    INFO: failed to load: coldfusion.CfmServlet
    Sep 16, 2014 8:30:59 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Allocate exception for servlet CfmServlet
    java.lang.NullPointerException
      at coldfusion.CfmServlet.init(CfmServlet.java:97)
      at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:121)
      at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:59)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1279)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1192)
      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:864)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:134)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:104 0)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.jav a:607)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)

  • Implement http tunnel in java

    Hi,
    I am developing a remote access application which allows to access remote machines terminal behind firewall and and NAT. I have looked at some technologies and scaled down to http tunneling and JXTA. I was hoping if some one could guide me to choose the best available one and any resource that implements it in java.
    Thanks in advance

    To get a packet from computer 1 to computer 2 with the following configuration,
    Computer1 <-> NAT/Firewall 1 <-> Internet <-> NAT/Firewall 2 <-> Computer 2
    192.168.1.1 72.1.15.6 72.1.15.7 192.168.1.1
    You end up with a problem. Computer one has a local IP address, as does Computer 2. Neither of them are directly globally accessible. The NAT/Firewall, however, is connected to a Global IP address, and so Computer 1 can send messages to NAT 2, and vice versa.
    If you set up a static route on the NAT, it will forward all incoming traffic on a port to a computer behind the NAT. So, if you configured port 5000 on each NAT to forward traffic to the target computers, anytime you addressed a packet for NAT<N>:5000, it would go to computer<N>.
    You can play a similar game with a rendezvous server. When a computer send out a packet, it goes to the NAT. The NAT then forwards that to the internet, and makes a note "Okay, if a response comes back from the place I'm sending this on the port I'm sending from, I'll forward that response back to the local computer that sent the packet in the first place. If you have a rendezvous server, you can do the following trick
    Computer 1 sends a message to server
    Computer 2 sends a message to server
    Server sends computer 1 the IP/PORT to use to talk to c2
    Server sends computer 2 the IP/PORT to use to talk to c1
    Computer 1 sends a message to the IP/PORT it was told to use
    NAT2 rejects the message because no message was sent to computer 1
    Computer 2 sends a message to the IP/PORT it was told to use
    NAT1 allows the message because Computer1 sent a message to computer 2
    Computer 1 sends a message to the IP/PORT it was told to use
    NAT2 allows the message because Computer2 sent a message to computer 1
    At that point, messages can flow between computer 1 and computer 2 across the internet.
    For more information, check out Section 3 of:
    http://www.brynosaurus.com/pub/net/p2pnat/

  • How to Record HTTP Requests and POST data

    Hai all..
    Can anyone help me to solve this issue..
    How to Record HTTP Requests and POST data by using java..
    regards
    Ranjith Nair

    You should read about TCP and splitting data stream into packets and learn how to understand packet header to assemble stream from packets.
    Actually there are few different stages:
    1. detect handshake to start new empty stream within your code;
    2. detect subsequent packets and assemble stream (there are counters within packet header and they will help).
    After creating start of TCP stream (usually 1KB is enough) you'll be able to detect is it HTTP request/header or no and start logging or ignoring packets for this connection.

  • Disabling HTTP on AS Java

    Hello Colleagues,
    after configuration to HTTPS on AS Java 7.0 Server we have to disable all HTTP connectivity now.
    I found different discussion to that issue but I am still not sure what are the right way.
    Please help to clarify this point to me.
    Many thanks in advance!
    Regards,
    Jochen

    Hi Jochen,
    In order to disable the HTTP access to your Java AS. You will have to login to Visual Administrator, and then under Service, go to the HTTP Provider details. You will find a value specifying both http and https values (if already configured). You can remove the http part, which will allow you to remove the http access.
    Regards,
    David

  • PI 7.0 SOAP message reply HTTP 500 and after the fault message

    Hello Everybody,
    I have the scenario RFC -> XI -> SOAP in synchronous mode.
    I use for the mapping XSLT because I have to put some dynamic data comming from the RFC in the header of envelope.
    At level of adapter receiver SOAP , I flag the "do not use envelop"
    In normal, that works .
    When the is an fonctionnal error in SOAP service, it sends me back an error HTTP 500 and afterwards the fault message in a soap envelop format. In that case, how can I pass over this error to treat the envelop because in adapter, it is stopped and it returns a short dump to the RFC.
    Is there somebody who can help me with this problem ?
    Thanks in adavance for your answers .
    Regards.
    Eric.

    Hi,
    In case of a SOAP error while processing the request, the SOAP HTTP server MUST issue an HTTP 500 "Internal Server Error" response and include a SOAP message in the response containing a SOAP Fault element
    Thanks,
    RamuV

  • HTTP Sender and HTTP Receiver .Pls advice urgent

    Hi All,
    Partner A (http) -- XI -
    Partner B(http)
    Now Trade Partner do not want to use HTTP client tool.
    He wants to send data through URL.
    Please make the full sender URL for the details below
    for Sender HTTP:
    XI system -- sapd0aa
    Client -- 100
    Port -- 8000
    Sender Service -- SS
    Sender Interface -- SI
    Sender Namespace -- http:
    abc
    Qos -- EO
    In Receiver HTTP Aadapter if I use RFC Destination does it has to be of Type G
    Regards

    Hi Henry,
    1. Where sender partner will send his XML if he uses the above URL?
    Whatever technology , partner is using to send the data, there are some APIs available for establishing the http connection and then sending the data on this HTTP connection.
    2. How the user name and password will be sent in the above URL as XI requires User Name and password.
    You can embed in the URL by adding sap-user=xyz&sap-password=abc
    Piyush

  • HTTPS, DNS and dynamically updating DNS records

    Hello to you all, if you are able to help with a DNS problem that I'm having then please accept my thanks and appreciation in advance.
    First some background information, I recently  moved my server from my studio to my house where a new purpose built studio will soon be erected. At my old studio any requests for myurl.com came in via the IP (whether that be http, https, ftp etc) from the domain registrar and the router would send the request to the relevant port number whether that be 80 for http or 443 for https etc and all was well as this location had a fixed IP address. Unfortunately at my new location whilst I have a much faster connection I do not have a fixed IP. To get around this I have the following set up (not ideal for a business I know but perfectly OK for home hosting); I set up two psuedo nameservers at no-ip.com (ns1myurl.com and ns2myurl.com) which tracks the changes in my IP address and updates its records accordingly, my registrar then sends any requests to these 'nameservers' and no-ip then forwards it on to my server. So far so good.
    The problem arises once the requests get to my server, whilst I have DNS set up, I can only recieve requests from a straight request to the server ie myurl.com will display the site without any problem, but if I then put a www in front of that or try to access the https part of my site (which is set up as a seperate site on the same server) then the server throws an error. I have tried to put an alias (CNAME) into the zone but it does not want to resolve the request. I have searched around but to no avail, I am totally new to DNS so am currently on a steep learning curve and fumbling around in the dark.
    The first thing that I need to get working is the request to be resolved correctly and then (and this is where the real fun starts!) is to dynamically update the IP in the DNS records as the IP changes. I will probably have to get help in on this as I understand that this requires BIND of which I know nothing about, first though I'd like to get the pages to be served up correctly. Advice, hints, tips or links to tutorials all greatly appreciated. Full set up listed below.
    Many thanks, David.
    Xserve PPC G5 running 10.5.8 unlimited set up as standalone OD master
    Xraid
    APC UPS
    CradlePoint MBR1200 Gateway router which acts as the DHCP
    http://myurl.com and https://myurl.com set up as 2 seperate sites and located on the Xraid
    Current DNS setup:
    Primary Zone name: myurl.com with nameservers ns1myurl.no-ip.info and ns2myurl.no-ip.info and allow zone transfers in checked
    Then
    Name
    Type
    Value
    myurl.com
    Primary Zone
            ns1myurl.no-ip.info
            Machine
    12.34.56.78 (external IP)
            ns2myurl.no-ip.info
            Machine
    12.34.56.78 (external IP)
            myurl.com.
            Machine
    12.34.56.78 (external IP)
            www.myurl.com.
            Alias
    myurl.com.
    With the reverse zone looking thus with allow zone transfers being checked
    Name
    Type
    Value
    56.34.12.in-addr.arpa.
    Reverse Zone
            12.34.56.78
            Reverse mapping
            myurl.com.

    Thanks for the reply Camelot, that part though I had already figured out. I now have this working, all I did was change the external IP to the internal one of the server with resolves with the .local machine name and all is working just fine (for now!). As long as I have primary zones set for each site and any alias or services set up on them then everything works well.. The real test will be when my ISP changes the IP, whilst my tests have proved successful the proof will be when they update the address.
    Thanks anyway. David.

Maybe you are looking for

  • Postoffice-startup-file not copied from SYS-volume

    We migrated a Groupwise 7.02-postoffice from a Netware 6.5-Sp5-server to a SLES10-SP1-server with the Novell GroupWise Migration Utility. When we started gwpoa the postoffice-startup-file was not in /opt/novell/groupwise/agenst/share/ We looked in th

  • System wide keyboard commands not responding

    My mac stops responding to system wide keyboard commands such as the Dashboard, Expose and Spotlight shortcuts. It also does not respond to Command-Tab to switch between applications. Hitting the keys for any of these leads to no response whatsoever.

  • Airport Extereme 6.1: I can't open those ports I wanted to!

    Hi everybody! I would like to open some ports in my Airport Extreme 7.6.1.  (software 6.1). Those ports are for example EyeTV 2170 and VLC 5900. I have Airport utility and I have tried to change port settings at network section. I have changed at net

  • How can I regulate the x-/y- scale of the WaveformGraph?

    In my program I indicate different signals after a certain time with the WaveformGraph. Is there a solution to give the WaveformGraph Values, which change automatically with the suitable signals. AutoScale isn't suitable. Thanks for help!

  • Will Not Sync Unless Done With Wifi

    So i've been doing the "Sync with wifi" thing for my ipod touch. But i've noticed that now when i go and plug my ipod into the computer with the cord, it will not read the ipod anymore and will not allow me to sync it unless its done by wifi. It use