Differentiating HTTP Request through a URL and a value change listener

Version Details:
Oracle JDeveloper 11g Release 1 11.1.1.4.0
Studio Edition Version 11.1.1.4.0
Build JDEVADF_11.1.1.4.0_GENERIC_101227.1736.5923
IDE Version: 11.1.1.4.37.59.23
Product ID: oracle.jdeveloper
Product Version: 11.1.1.4.37.59.23
ADF Business Components     11.1.1.59.23
Java(TM) Platform     1.6.0_21
Oracle IDE     11.1.1.4.37.59.23
Versioning Support     11.1.1.4.37.59.23
Base Details:
The Product, that a different team is working on (<i><b>which I cannot access, code, touch,...</b></i>), creates reports and essentially generates a URL with a bunch of parameters:
http://<host>:<port>/myApplication/main.jspx?parameter1=value1&parameter2=value2...When the user clicks on an "Edit" button, a modal popup window is displayed (using jQuery) with an embedded iFrame with its source pointing to the above URL.
The "myApplication" is an ADF application which brings up an ADF form based on the parameters. Once the user enters the data, validations occur and the data is written into a total of 3 different Tables in the Database. Once the operation is finished, the user closes the popup by clicking on the "X" button of the popup window, which essentially does "popup.*hide()*".
Limitations:
<li>Since there are varied combination of parameter values and associated ADF forms, taskflows is not* an option.
<li>Since the logic of generating the ADF form is not straightforward, ADF BC is not* an option.
<li>Since validations are based on the value change listeners, the managed bean has to be a session scope_ bean.
Problem:
When, for the first time, the user clicks on the Edit button with a particular set of parameter values, the corresponding ADF form is displayed and things work normal. Since the managed bean is under session scope, the form generated for the first popup window stays the same for any subsequent popup windows, even when the URL and its parameters are completely different. As I can not listen to the popup close event, I cannot invalidate my session either.
I tried using filters in the web.xml to grab the request and apply the business logic. Due to the presence of multiple value change listeners (too many <tt>autosubmit=true</tt>), every value change listener triggers a request and so the business logic gets applied with every value change.
After some tests, I deduced that the difference between the call from iFrame and the call from value change is the HTTP Request Method - GET for iFrame and POST for value change listener. So in my filter I apply the business logic when there is a GET request and not apply when its a POST request.
Turns out, that is not a valid enough differentiation between the two requests being made. Sometimes, even the value change listeners are issuing a GET request.
Question:
*<font color="red">1</font>*. Is there a way to force the value change listeners to always trigger a POST request?
*<font color="red">2</font>*. Is there a way to differentiate the requests originating from the other team's Product and those generated by my own value change listeners?
*<font color="red">3</font>*. Is there a different approach, incorporating the above-mentioned limitations, to clear out the session scope each time when a request is made through iFrame? That is, whenever a request is made through the other team's Product?
Edited by: user737922 on Apr 13, 2011 10:58 AM

_(Temporary) Solution_:
Summary:
I am using the request parameter <b><tt>_adf.ctrl-state</tt></b> to differentiate between the HTTP requests that my application receives.
Details:
When I receive the request from the other team's Product, I receive a <tt>GET</tt> and a <tt>adf.ctrl-state</tt> value which I store into a local variable in my session-scoped managed bean. The <tt>adf.ctrl-state</tt> value stays the same for all requests (<tt>GET</tt> or <tt>POST</tt>) made from within my own application. It changes only when there is a new request from the other team's Product.
Also, as my application is accessed through an iFrame, there is no possibility of the generated URL being modified by the end-user.
For now it seems that the solution is appropriate but I am not fully confident if relying on the <tt>_adf.ctrl-state</tt> value is the best approach.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to get the number and response time of HTTP request through Weblogic?

    hi,
    does anybody know how to get the HTTP request information through Weblogic server, such as the number of HTTP request in 1 min and the average response time of request in 5 mins ?
    Or is there anyway i can do it through monitoring and get these data then? If so, please help tell me.
    Thanks in advance
    BTW, we don't have the 3rd-party monitoring tool here.

    Hi,
    tables: usr02, usr41.
    data: OPCODE_MODE_COUNT(1) TYPE X VALUE 3,
          modes like sy-index,
          u_MODES LIKE MODES.
    select * from usr02.
      select * from usr41 where BNAME = usr02-bname.
        CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE_MODE_COUNT
          ID 'TID' FIELD usr41-TERMID
          ID 'MODES' FIELD MODES.
        IF SY-SUBRC = 0.
          u_MODES = u_MODES + MODES.
        ENDIF.
      endselect.
      if sy-subrc = 0.
        write:/ usr02-bname, u_MODES.
      endif.
      clear u_modes.
    endselect.

  • Multiple HTTP requests through same connection

    Hi...
    I am writing an application which connect to its server through HTTP protocol and the server is basicaly a bunch of servlets hosted somewhere (Right not it in the tomcat running in my PC)
    I know that with Connection Keep-Alive header you can keep the connection alive and do multiple requests from the same server.
    Can some one point me to where can I find some sample code which shows how to send multiple requests through same URL conection or URL object. What i cant figure out is how to reset the URL connection or its streams a and make them send anotehr request message to the serverso server can respond.
    Or do I have to do this manualy (using sockets)

    You SHOULD be able to do a HttpUrlConnection method. However, I have hand-coded HTTP server and client apps and the keep-alive is rarely enabled in servers.
    This is due to better handling of millions of unique hosts requesting, unlike a network os, which is made the other way around.

  • Re: (forte-users) HTTP request through proxy server

    Daniel -
    No, it does not. ;)
    How do you say to HTTPRequest to go through proxy?
    Thanks,
    Taras
    Daniel Nguyen wrote:
    >
    Hi,
    It works very well. I have experienced this model for a distant Forte client
    calling a Forte Server service Object for instance without any environment
    and without TCP access (passing through firewall for instance).
    It has also worked very well to make an injectot to improve Web Enterprise
    and IIS using the SendRequest from HTTPAccess.
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    http://perso.club-internet.fr/dnguyen/
    Taras Katkov a &eacute;crit:
    HTTP request through proxy server using forte HTTP library?
    Any experience?
    Thanks,
    Taras
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com--
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    You can also use the HTTP-DC project.... You don't
    need Web Enterprise for this. From what I can tell,
    this is available in L.x on....
    There is api documentation in M.2 (with scant
    examples.)
    There's a special process to put the project in your
    repository (it isn't installed in the repository in
    the standard install,) the documentation in M.2
    (probably in M.0 too, AFAIK) that tells you how to do
    this (look for HTTP-DC in the online help.)
    I haven't done much with it yet, I've just installed
    it. If anybody out there has examples, that'd be
    great. I'll try to contribute more the moment I get a
    chance to explore it....
    Christopher Fury
    BellSouth Communications Systems
    --- Daniel Nguyen <dnguyenclub-internet.fr> wrote:
    Hi,
    If you have Web Enterprise, you can user
    HttpAccess.SendRequest().
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    Amin, Kamran a &eacute;crit:
    Is there any way to make a HTTP request from TOOLto another HTTP Service?
    thanks in advance.
    For the archives, go to:
    http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. Tounsubscribe, send in a new
    email the word: 'Unsubscribe' to:forte-users-requestlists.xpedior.com
    For the archives, go to:
    http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To
    unsubscribe, send in a new
    email the word: 'Unsubscribe' to:
    forte-users-requestlists.xpedior.com
    Kick off your party with Yahoo! Invites.
    http://invites.yahoo.com/

  • Http Request through URL Connection?

    Hi ,
    Iam using an Applet (under JRE 1.3.0). Iam trying to send a Http Request using URL Connection. It is working fine . However, if the response time of the server is more than 3 minutes , the Response is not coming back to the server and the Applet is in a loop trying to read from the Server. I have observed that the request is sent to the server and it is processed successfully.
    When I test it in my local devp. machine it is working fine till 15 minutes which is my requirement.
    Can anybody suggest what should be the possible reasons and any workaround for it?
    Regards,
    TejoKiran.Y

    Iam copying the code fragments for the Applet Iam using . Is it a problem with the code? I heard that the URLConnection never times out . How is that it is not able to read the Response?
    <CODE >
    <HttpMessage>
    public class HttpMessage {
    URL servlet = null;
    Hashtable headers = null;
    public HttpMessage(URL servlet) {
    this.servlet = servlet;
    public InputStream sendGetMessage(Properties args) throws IOException {
    String argString = ""; // default
    if (args != null) {
    argString = "?" + toEncodedString(args);
    URL url = new URL(servlet.toExternalForm() + argString);
    // Turn off caching
    URLConnection con = url.openConnection();
    con.setUseCaches(false);
    // Send headers
    sendHeaders(con);
    return con.getInputStream();
    private void sendHeaders(URLConnection con) {
    if (headers != null) {
    Enumeration enum = headers.keys();
    while (enum.hasMoreElements()) {
    String name = (String) enum.nextElement();
    String value = (String) headers.get(name);
    con.setRequestProperty(name, value);
    </HttpMssage>
    <Code used to Read the Response.>
                        URL url = new URL(getDocumentBase(),"/ccls/test/delay.jsp");
                        HttpMessage msg = new HttpMessage(url);
                        InputStream in = msg.sendGetMessage(null);
                             char[] buff = new char[2048];
                             int bytesRead;
                             int ch;
                             StringBuffer sbtextbox = new StringBuffer("");
                             DataInputStream data = new DataInputStream(
                                                           new BufferedInputStream(in));
                             String line;
                        while ((line = data.readLine()) != null) {
                                  sbtextbox.append(line+"\r\n");
    </Code used to Read the Response.>
    </CODE>

  • How to send POST HTTP Request through PI .

    Hi ,
    I am trying to send a XML mesage at HTTP server from SAP PI 7.1 .
    but not able to , reason is HTTP guy telling me is that ,i am sending a get request through SAP PI 7.1 and it should be POST.
    Where to change this this thing , so that only post request should go.
    There is one more thing , i am facing following request only in Quality . In Development request is going as Post and every thing running fine ...
    Regards
    PS

    It was always HTTP from our end , some config was missing at HTTP guys end , which solve the problem ..
    So there was no issue at PI end.

  • Targeted HTTP Requests through SonicWALL Site-to-Site VPN

    I have a B2B tunnel to one of our customers. All HTTP/HTTPS traffic from our main office for those addresses goes across the B2B.Now, I have a remote office connected to the main office via site-to-site VPN. How can I target HTTP/HTTPS requests for only the customer websites to use the site-to-site VPN to our office, then the B2B, while allowing other Web traffic to go straight out through the remote office? I have already added the subnets used by the B2B to the access lists at both ends of the site-to-site, but computers at the remote office cannot load Web pages, because the requests are not coming from our B2B IP address. nslookup and ping work from the remote office; DNS is resolving the name to the correct IP address. However, the HTTP/HTTPS requests are going straight out through the remote office firewall without hitting the...
    This topic first appeared in the Spiceworks Community

    Hi
    I looked through the similar questions and I cannot find the answer. My VPN is working correctly and I can ping every LAN interface address objects specified in my routes but I'm unable to ping or access end devices beyond that. IPS and the GAV is not enable since I don't have the licenses, so theirs no concern there. Something is telling me that it could be a basic route needs to be in place on VPN > LAN but that was created in the initial VPN configuration.
    For example I can ping Remote LAN interfaces 172.16.0.254, 172.18.0.254 but I cant ping the devices in those subnets. 
    This topic first appeared in the Spiceworks Community

  • Http Request - error in URL when params contain spaces

    Hi friends , I invoke a servlet from a HTTP client using the GET method. I pass two Strings which contain spaces and non-english alphabets.
    I get malformed URL when I invoke the servlet with these parameters in the URL.
    Can someone please help and tell me how to pass spaces and special characters in the URL. Do I need to use some escape characters?
    TIA
    Harish

    You can encode the strings prior to passing them to the servlet as follows:
    String parm1="http://www.mySite.com/this includes spacees/test.htm";
    String param2=" what ever in non-english alphabets";
    parm1=URLEncoder.encode(parm1);
    parm2=URLEncoder.encode(parm2);
    ;o)
    V.V.
    PS: Sorry click the Post! button too soon before the sample code was completed!

  • Http request through Apache

    I have few EJB/JSP applications deployed on OC4J. I want to access applications
    on Apache deployed on same/other machines . As this application is intended to be used by few administrators, I need to authenticate the user before access.
    Is there any standard way to achieve this?
    What I need to configure on OC4J/Apache.
    Do I need to make any changes in the application to achieve this ?
    Any thoughts
    --pranay   

    Hi Pranay,
    I can only suggest the following references (although I'm not sure
    if they will help you).
    http://www.elephantwalker.com
    http://www.atlassian.com
    http://www.orionserver.com
    http://www.orionsupport.com
    http://tahiti.oracle.com
    Good Luck,
    Avi.

  • How to update and save values changes during run time

    I have string and numeric controls on my front panel that the operator can change the values of and was wondering if there was any way to save these changes everytime the vi was closed so they would stay current???
    thanks
    dale walker
    [email protected]

    If you want to change the default settings, its a little involved, mainly because your editing a control's settings while in 'run' mode, but study the example in the below link to get you going.
    Another method is to write your values in a text file. This could be part of your closing routine before actually stopping the VI's run. Then, upon the next running of the VI, your initiating routine would involve reading the text file to populate your controls/indicators. I often use these text files because users can easily view them with Wordpad, etc., as needed, without needing labview on their PC.
    Good luck with it, Doug
    http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&2C14132F826F839F8625683A000B0B99&cat=DB5863CD70417B07862567930070A058

  • Value Change Listener and field disable property in Ajax ADF component

    Hi. I have used the Ajax ADF component in my application. It is working fine but I am unable to implement the ValuechangeListener property and disable property for this component. Can someone please help and tell me how i can implement these properties for the component? Thanks in advance.

    Hi,
    I have no clue of what you are talking about.
    Frank

  • Creation of shopping cart through HTTP request

    Hello all, I am trying to create a shopping cart through a HTTP request.
    The URL I am managing is the same that the one that the Web Service BBPSC01 uses.
    Using the following code I cannot connect to the server in background, the error "This browser is not supported" is launched.
    In addition to this, I can open the URL successfully via R/3 when executing online.
    Help very appreciated!
    Thanks.
    data declarations
    DATA: client TYPE REF TO if_http_client.
    DATA: host      TYPE string VALUE 'host',
          host2      TYPE string,
          service   TYPE string VALUE '8000',
          path      TYPE string VALUE '/sap/bc/gui/sap/its/bbpsc01/?sap-client=020&sap-language=EN',
          errortext TYPE string. "used for error handling
    DATA: dest(13) TYPE c.
    dest = 'ZPORTAL_CESTA'.
    CALL METHOD cl_http_client=>create_by_destination
      EXPORTING
        destination              = dest
      IMPORTING
        client                   = client
      EXCEPTIONS
        destination_not_found    = 1
        internal_error           = 2
        argument_not_found       = 3
        destination_no_authority = 4
        plugin_not_active        = 5
        OTHERS                   = 6.
    IF sy-subrc NE 0.
      WRITE: / 'Create failed, subrc = ', sy-subrc.
      EXIT.
    ENDIF.
    set http method POST
    CALL METHOD client->request->set_method(
      if_http_request=>co_request_method_post ).
    client->request->set_version(
         if_http_request=>co_protocol_version_1_1 ).
    client->request->set_header_field( name = '~request_method'
    value = 'GET' ).
    set request uri (/<path>[?<querystring>])
    DATA uri TYPE string.
    uri = path.
    cl_http_utility=>set_request_uri( request = client->request
                                      uri     = uri ).
    FIN: conectamos el final de la peticion
    Send
    DATA timeout TYPE i.
    CALL METHOD client->send
      EXPORTING
        timeout                    = timeout
      EXCEPTIONS
        http_communication_failure = 1
        http_invalid_state         = 2
        http_processing_failed     = 3
        OTHERS                     = 4.
    IF sy-subrc NE 0.
      DATA: subrc TYPE sy-subrc.
      CALL METHOD client->get_last_error
        IMPORTING
          code    = subrc
          MESSAGE = errortext.
      WRITE: / 'communication_error( send )',
             / 'code: ', subrc,
             / 'message: ', errortext.
      EXIT.
    ENDIF.
    CALL METHOD client->receive
      EXCEPTIONS
        http_communication_failure = 1
        http_invalid_state         = 2
        http_processing_failed     = 3
        OTHERS                     = 4.
    IF sy-subrc NE 0.
      CALL METHOD client->get_last_error
        IMPORTING
          code    = subrc
          MESSAGE = errortext.
      WRITE: / 'communication_error( receive )',
             / 'code: ', subrc, 'message: '.
      EXIT.
    ENDIF.
    DATA return_str TYPE string.
    return_str = client->response->get_cdata( ).
    close
    CALL METHOD client->close
      EXCEPTIONS
        http_invalid_state = 1
        OTHERS             = 2.
    DATA html_control TYPE REF TO cl_gui_html_viewer.
    DATA container   TYPE REF TO cl_gui_custom_container.
    DATA html_table TYPE TABLE OF char255.
    Create container for HTML viewer
    CREATE OBJECT container
      EXPORTING
        container_name              = 'CONTAINER'
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5.
    IF sy-subrc NE 0.
      MESSAGE e208(00)
         WITH 'The control HTML_CONTAINER could not be created'.
    ENDIF.
    CREATE OBJECT html_control
      EXPORTING
        parent = container.
    CALL FUNCTION 'CONVERT_STRING_TO_TABLE'
      EXPORTING
        i_string         = return_str
        i_tabline_length = 255
      TABLES
        et_table         = html_table.
    DATA: l_doc_url(255) TYPE c.
    CALL METHOD html_control->load_data
      EXPORTING
        type         = 'text'
        subtype      = 'html'
      IMPORTING
        assigned_url = l_doc_url
      CHANGING
        data_table   = html_table.
    CALL METHOD html_control->show_url
      EXPORTING
        url = l_doc_url.

    Dear Poster
    Your thread has had no response since it's creation over
    2 weeks ago, therefore, I recommend that you either:
    - Rephrase the question.
    - Provide additional Information to prompt a response.
    - Close the thread if the answer is already known.
    Thank you for your compliance in this regard.
    Jason Boggans
    SAP SRM SDN Moderator

  • Setup WLS5.1 to accept only HTTPS requests (and not HTTP requests)...

    Greetings,
    Does anyone know how to configure Weblogic Server 5.1 so that the web server will
    only accept HTTPS requests (on port 7002) and not accept HTTP requests (on port
    7001)? I tried commenting out the HTTP ListenPort line in weblogic.properties,
    but WL still served up a page via HTTP. Thanks for any help,
    Steve

    Write a startup class which implements weblogic.security.net.ConnectionFilter
    interface
    Refer our javadocs at
    http://www.weblogic.com/docs51/classdocs/javadocs/index.html
    Also
    http://www.weblogic.com/docs51/classdocs/API_acl.html#filtering
    Kumar
    Steve wrote:
    Greetings,
    Does anyone know how to configure Weblogic Server 5.1 so that the web server will
    only accept HTTPS requests (on port 7002) and not accept HTTP requests (on port
    7001)? I tried commenting out the HTTP ListenPort line in weblogic.properties,
    but WL still served up a page via HTTP. Thanks for any help,
    Steve

  • 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.

  • 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...

Maybe you are looking for