5 Replies Latest reply: May 6, 2012 4:21 AM by 882069 RSS

    how to handle http 302 response in OEG

    933326
      how to handle http 302 response.
      The URL has moved <a href="https://............................


      I am using "Connect to URL" and "Reflect message" filters and I am getting http 302 response. In the http esponse body/content I have the "The URL has moved <a href="https://............................"
      How to connect to this url.


      Thank you very much for your help.
        • 1. Re: how to handle http 302 response in OEG
          882069
          Does the 302 response to OEG contain a "Location" HTTP header which contains the new location to route to: https://............................
          If it does, then if you select the "Advanced" > "Handle Redirects" then OEG will redirect automatically

          Otherwise you will need to add some filter logic after your connection filter which checks the http.response.status and if 302 extracts the URL from the content.body and then connects to the URL
          • 2. Re: how to handle http 302 response in OEG
            933326
            Connect to URL Advanced Settings: Handle Redirects is checked.

            Response has "Location" and has the valid redirect URL, I am still not able to get this working. It is not able to redirect to new URL.

            thank you very much for your help
            • 3. Re: how to handle http 302 response in OEG
              882069
              Can you set the trace level to DATA on the port receiving the message in OEG. Repeat the problem and send the trace file to support@vordel.com

              Thanks
              • 4. Re: how to handle http 302 response in OEG
                933326
                hi

                I took your advise on the second approach and added new filter to catch 302 response and read the new URL from Location. Here is the flow.

                Connect to URL --> Is HTTP CODe =302 --> Retrieve Location from Http Header- Rewrite URL - Dynamic Router - Connection



                I am getting a new error as below. I verified the certificates using the below open ssl comands and added them to the certificate store in OEG. The error comes from the Redirect URL which is cs12.salesforce.com

                C:\Program Files\GnuWin32\bin>openssl s_client -connect test.salesforce.com:443 -showcerts
                and
                C:\Program Files\GnuWin32\bin>openssl s_client -connect cs12.salesforce.com:443 -showcerts

                thank you for your time and help.


                ERROR 06/May/2012:00:22:23.125 [14e0] nested fault: SSL protocol error
                error:140CF086:SSL routines:SSL_VERIFY_CERT_CHAIN:certificate verify fai
                led
                error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate veri
                fy failed:
                java.lang.RuntimeException: SSL protocol error
                error:140CF086:SSL routines:SSL_VERIFY_CERT_CHAIN:certificate verify fai
                led
                error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate veri
                fy failed
                at com.vordel.dwe.ConnectionCache.getConnection(Native Method)
                at com.vordel.circuit.net.ConnectionProcessor$State.tryTransaction(Conne
                ctionProcessor.java:482)
                at com.vordel.circuit.net.ConnectionProcessor.invoke(ConnectionProcessor
                .java:650)
                at com.vordel.circuit.InvocationEngine.invokeFilter(InvocationEngine.jav
                a:154)
                at com.vordel.circuit.InvocationEngine.invokeCircuit(InvocationEngine.ja
                va:43)
                at com.vordel.circuit.InvocationEngine.processMessage(InvocationEngine.j
                ava:229)
                at com.vordel.circuit.SyntheticCircuitChainProcessor.invoke(SyntheticCir
                cuitChainProcessor.java:36)
                at com.vordel.dwe.http.HTTPPlugin.invokeDispose(HTTPPlugin.java:290)
                at com.vordel.dwe.http.HTTPPlugin.invoke(HTTPPlugin.java:131)
                • 5. Re: how to handle http 302 response in OEG
                  882069
                  Import the entire cert chain in to OEG certificate store and flag the issuer of the server cert "cs12.salesforce.com" as trusted