HTTPS Connection Error

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf HTTPS Connection Error

  • Creator
    Topic
  • #48555
    Noel Wallis
    Participant

      Cloverleaf 5.3 running on AIX.

      I was hoping someone has done this before and maybe could help me.  I have been able to establish a HTTPS session to a remote server (apache) but I am stumped from that point on.  I have done a number of different types of interfaces but this is the first using HTTP or HTTPS.

      If I do a GET, the thread seems to swap and confirm certificates OK (Query TPS = httpQuery) and then I get back the appropriate Web Page from the other end, thats good.  Now if I change it to a POST and pass anything to it I get a “httpQuery error: httppost requires a ‘DATA’ key” error (same with PUT).  This seems to indicate that I am missing something crucial to establish the session but I haven’t a clue what.  It does not seem to verify the certificates in either POST or PUT methods, just jumps to the above error.

      After searching this forum and the archives I have not been able to find out anything that can help me get past this error and the Quovadx manual on HTTPS is useless.  I effectively want to pass records to the server, and at this stage I just want to pass anything and get something back from the remote server (like an error) to prove that I am connecting and can pass data.

      I hope someone can help.

    Viewing 13 reply threads
    • Author
      Replies
      • #58972
        Noel Wallis
        Participant

          I have successfully got my HTTPS interface with ClienAuth going, so I will add my findings just in case someone else hits the same problems.  Where I went wrong was that the arguments for httpQuery were wrong, you just need {MSGUSE DATA}.  Important steps are:

          1 : You need a Cloverleaf SSL license.

          2 : Set up your web browser (I used both Firefox and IE) with the appropriate certificates and ensure that you can connect to the HTTPS page.  You will find that Firefox, IE and Cloverleaf all use different format certificates, and I found that Openssl (free download) a useful tool for the various conversions.  For Cloverleaf I originally converted them all to .pem (and that worked) but .cer does work for the certificate file (I did not try the other combinations).

          3 : Setup Cloverleaf thread.  First off set thread up as GET to ensure that your certificates are correct,  if you successfully connect you will get back the web page in the log.  Ensure that you setup httpQuery with args {MSGUSE DATA} ! (as I discovered the GET works work fine without the argument but the POST and PUT won’t !).

          Once you get the GET working the rest is just a matter of changing around the setup to POST or whatever.  With mine I converted it to a POST and set it to message driven.

        • #58973
          Pete Gilbert
          Participant

            Is there a way to get httpquery to display the http header information that is sent with the request? I have added header paramaters to the configuration, but I haven’t found a way to see what Cloverleaf builds and sends… It logs the message, but not the headers.

            This is what I would like to see

            User-Agent: QDX Integration Services 5.3

            Host: nodcrsie12sv.no.trinity-health.org

            Content-Type: text/xml

            charset=utf-8

            SoapAction: “”

            Authorization: Basic dHJpbml0eTp0cmluaXR5MQ==

            Content-Length: 1497

          • #58974
            Pete Gilbert
            Participant

              Here is what I have in the log

              Executing: httppost {URL https://app.wellcentive.com/Training/StorageEJB/StorageService/StorageService} {METHOD POST} {HEADERS {{Content-Type text/xml} {SOAPAction “”} {Host nodcrsie11sv.no.trinity-health.org} {User-Agent “QDX Integration Services 5.3”}}} {PROXY {{HOST {}} {PORT {}} {CREDENTIALS {}} {USER {}} {PASS {}}}} {REPLYGEN {

                         { TYPE none }

                     }} {TIMEOUT -1} {WAIT 0} {AUTH { {CREDENTIALS VHJpbml0eTpxVzE5biF2c3E=}}} {HTTPS { {MODE ClientAnon}}} {DATA {


                xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/

                xmlns:soapenc=”http://schemas.xmlsoap.org/soap/encoding/

               

                xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance

                xmlns:xsd=”http://www.w3.org/2001/XMLSchema“>

                http://schemas.xmlsoap.org/soap/encoding/“>

                   http://storage.interfaces.wellcentive.com“>

              MSH|^~&|PATHNET|SJMHS|TDS|SJMHS|20060823024300-0400||ORU^R01|07|P|2.1

              …Rest of messasge goes here

                     

               

               

              }}

              (httpQuery/Run) Error fetching URL https://app.wellcentive.com/Training/StorageEJB/StorageService/StorageService: HTTP/1.1 401 Unauthorized

              How do I see the http headers that httpQuery built? (Note that I have to escape the ampersand so that I build a valid xml doc 🙂

            • #58975
              Pete Gilbert
              Participant

                httpput lists an argument of {DEBUG 1} to display the http headers. httpquery doesn’t appear to pass this argument to httpput…or I may just be putting it in the wrong place. I tried turing on debug mode for the process as Quovadx suggested, but that doesn’t work either.

              • #58976
                Charlie Bursell
                Participant

                  Pete:

                  I think you mis-understand the DEBUG flag.  It is not for headers, it is for general debug info.  I ran a simple htttpput to ww.quovadx.com and got the following debug info:

                  Sending put request:

                  PUT / HTTP/1.1

                  From: anonymous@unknown.com

                  User-Agent:  HCDC __cHTTPClient

                  Host:        http://www.quovadx.com

                  Connection: close

                  Content-Type: application/x-www-form-urlencoded

                  Content-Length: 5

                  What other debug info do you expect?

                • #58977
                  Pete Gilbert
                  Participant

                    I had tried setting degug on the httpquery call in the Http CLient Protocol Properties, but that did not work. So I have coded httpost with debug set to view the headers. This is the call

                    httppost {{URL https://app.wellcentive.com/Training/StorageEJB/StorageService/StorageService} {DATA $NewMsg} {HEADERS {{Content-Type “text/xml; charset=utf-8”} {SOAPAction uploadMessage} {Host nodcrsie11sv.no.trinity-health.org} {User-Agent “QDX Integration Services 5.3”} {Authorization “Basic VHJpbm10eTpxVzE5biF2c3E=”} {Content-Length $soapEnvLength}}} {AUTH {{SCHEME basic} {USER Trinity} {PASSWD qW19n!vsq}}} {HTTPS {MODE basic}} {DEBUG 1}}

                    and this is what it displays

                    Sending post request:

                    POST /Training/StorageEJB/StorageService/StorageService HTTP/1.1

                    From: anonymous@unknown.com

                    User-Agent:  HCDC __cHTTPClient

                    Host:        app.wellcentive.com

                    Connection: close

                    Content-Type:

                    Content-Length: 7

                    It is not reading my http header list. Have I got the syntax wrong? It looks like the example in the Reference Guide. It is also not resolving the $NewMsg or the Content Length.

                  • #58978
                    Pete Gilbert
                    Participant

                      I have changed my code as follows:

                      keylset postArgs URL https://app.wellcentive.com/Training/StorageEJB/StorageService/StorageService

                      keylset postArgs DATA $NewMsg

                      keylset headerList Content-Type text/xml

                      keylset headerList SOAPAction uploadMessage

                      # keylset headerList Host nodcrsie11sv.no.trinity-health.org

                      # keylset headerList User-Agent QDX_Integration_Services_5.3

                      keylset postArgs HEADERS $headerList

                      keylset postArgs DATA $NewMsg

                      keylset postArgs HTTPS “MODE ClientAnon”

                      keylset authlist SCHEME base-64

                      keylset authlist USER Trinity

                      keylset authlist PASSWD VHJpbm10eTpxVzE5biF2c3E=

                      keylset postArgs AUTH $authlist

                      keylset postArgs DEBUG 1

                      echo $postArgs

                      set retval [httppost $postArgs]

                      echo $retval

                      This is the output:

                      {URL https://app.wellcentive.com/Training/StorageEJB/StorageService/StorageService} {DATA {


                        xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/

                        xmlns:soapenc=”http://schemas.xmlsoap.org/soap/encoding/

                       

                        xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance

                        xmlns:xsd=”http://www.w3.org/2001/XMLSchema“>

                        http://schemas.xmlsoap.org/soap/encoding/“>

                           http://storage.interfaces.wellcentive.com“>

                      MSH|^~&|PATHNET|SJMHS|TDS|SJMHS|20060815164700-0400||ORU^R01|07|P|2.1

                      PID|||000000003000118|07000|MSBUGUTGRAHAM^LABEMR^2||19850608|F||B||||||||000180015706221|018001570

                      PV1|||MLAB|||||||07A||||||||S|6221|||||||||||||||||||||||||20060809105800-0400

                      ORC|RS|1|||CM||||20060815164100-0400|MKGENLB||700219^Graham,Daniel|MLAB

                      OBR||01A449BAD|0000622700044|1001310^USODR^SODIUM, RANDOM-URINE|RT|20060815164100-0400|20060815164100-0400|||MGHPPJR|||PRE GO LIVE TEST|20060815164100-0400|OTHER|700219^Graham,Daniel|||||01819307120001010100131024530835824530835800000000101|||LA|F||RT^^^20060815164100

                      OBX|001|NM|1001310^USODR||100|MMOL/L|||||F

                             

                       

                       

                      }} {HEADERS {{Content-Type text/xml} {SOAPAction uploadMessage}}} {HTTPS {MODE ClientAnon}} {AUTH {{SCHEME base-64} {USER Trinity} {PASSWD VHJpbm10eTpxVzE5biF2c3E=}}} {DEBUG 1}

                      {STATUS {HTTP/1.1 400 Bad Request}} {HEADERS {}} {BODY {}}

                      Sending post request:

                      POST /Training/StorageEJB/StorageService/StorageService HTTP/1.1

                      From: anonymous@unknown.com

                      User-Agent:  HCDC __cHTTPClient

                      Host:        app.wellcentive.com

                      Connection: close

                      Content-Type:

                      Content-Length: 1194

                      Why isn’t it using my headers?????!!!!!

                    • #58979
                      Jim Kosloskey
                      Participant

                        Pete,

                        Is it possible Unicode is getting in your way?

                        Jim Kosloskey

                        email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                      • #58980
                        Pete Gilbert
                        Participant

                          How would that keep httppost from processing the HEADERS?

                        • #58981
                          Jim Kosloskey
                          Participant

                            Pete,

                            Sorry I posted in the wrong topic.

                            Jim Kosloskey

                            email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                          • #58982
                            Pete Gilbert
                            Participant

                              I got this answer from cloverleaf suport:

                              I was informed that this is a documented bug, HUBad10240, that will be corrected with the release of Cloverleaf 5.5.

                              Implementation (for versions with this issue) used tcl lib cURL to overcome this, and send SOAP transactions.

                              In current releases tcl cURL is part of Cloverleaf, and all work-arounds then become part of the standard code release.

                            • #58983
                              Dennis Pfeifer
                              Participant
                              • #58984
                                Pete Gilbert
                                Participant

                                  I saw the related thread. Unfortunately, we are running qdx 5.3, which does not have the tclcurl package installed. The only copy of the package that I could find wanted me to compile and build it, and I haven’t found the time to figure that out.

                                • #58985
                                  Pete Gilbert
                                  Participant

                                    Quovadx sent us the tclcurl package with ssl enabled, and I was able to make that work.

                                Viewing 13 reply threads
                                • The forum ‘Cloverleaf’ is closed to new topics and replies.