1. Vladimir K.
  2. PowerBuilder
  3. Wednesday, 30 August 2023 18:27 PM UTC

Hi all.

Perhaps someone can steer me in the right direction.

Help will be greatly appreciated.

Here is what we have and it is been working with TLS 1.0 flawlessly for years.

(very short version):

oleobject oXMLHttp

string s_xml, s_error, s_response

s_xml = &

'<?xml version="1.0" encoding="utf-8"?>' + &
  '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' + &
  '<soap:Header>' + &
    '<SecurityContext xmlns="http://www.xxxx.com/bbb/1.0">' + &
        '<ClientCode>code123</ClientCode>'
    '</SecurityContext>' + &
 '</soap:Header>' + &
    '<soap:Body>' + &
       '<data>' + &
        '<CompanyCode>0</CompanyCode>' + &
        '<VendorCode>0</VendorCode>'
      '</data>' + &
   '</soap:Body>' + &
  '</soap:Envelope>'

 

oXMLHttp = CREATE oleobject

oXMLHttp.ConnectToNewObject('MSXML2.XMLHTTP')

try
    oXMLHttp.Open ('POST', 'https://test-integration.xxxxx.com/xxxWebService.asmx', FALSE)
    oXMLHttp.setRequestHeader('Content-Type', 'text/xml;charset=utf-8')
   

   oXMLHttp.Send(s_xml)
   

  s_response = oXMLHttp.ResponseText

catch (RuntimeError rte)   
  s_error = rte.getMessage()
end try

DESTROY oXMLHttp

if s_error <> '' then messagebox() and return

else parse s_response etc...

THE END

We received the notification from partner, that they will be changing to TLS 1.2

I did some digging around and come across:

https://support.hcltechsw.com/community?id=community_question&sys_id=c48f487edbbb14d8a45ad9fcd39619fe

Looks like exactly what i need, so i did some changes:

FROM:

//i_rc = oXMLHttp.ConnectToNewObject('MSXML2.XMLHTTP') // Msxml2.ServerXMLHTTP.6.0 or 'Microsoft.XMLHTTP

TO:

/**************** Begin force TLS 1.2 ******************************************************************/
// use WinHttp.WinHttpRequest.5.1 instead MSXML2.XMLHTTP ...
i_rc = oXMLHttp.ConnectToNewObject('WinHttp.WinHttpRequest.5.1')
// force TLS 1.2 ...
oXMLHttp.Option[9] = 2048
oXMLHttp.Option[6] = TRUE
********************************** END *************************************************************/

Doesn't look like it is working, getting back:

<html>
   <head><title>403 Forbidden</title></head>
    <body>
      <center><h1>403 Forbidden</h1></center>
      <hr><center>Microsoft-Azure-Application-Gateway/v2</center>
   </body>
</html>

 

What am i missing? Doing wrong?

Any help will be greatly appreciated.

Thank you

Sincerely

Vlad

Marco Meoni Accepted Answer Pending Moderation
  1. Thursday, 31 August 2023 08:07 AM UTC
  2. PowerBuilder
  3. # 1

Hi Vladimir,

as anticipated by Miguel, PB developers can simply use HttpClient object for Tls 1.2 and above compatibility.

https://docs.appeon.com/pb2022/objects_and_controls/HTTPClient_object.html

Cheers,

.m

Comment
  1. Armeen Mazda @Appeon
  2. Thursday, 31 August 2023 15:03 PM UTC
Adding to what Marco said, PowerBuilder 2022 and newer supports TLS 1.3 as well.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 30 August 2023 20:30 PM UTC
  2. PowerBuilder
  3. # 2

Hi,

See if there's anything on this page that can help you: https://markohoven.com/2020/03/06/msxml2-serverxmlhttp-and-tls1-2/

Comment
  1. Miguel Leeuwe
  2. Wednesday, 30 August 2023 20:43 PM UTC
I've never used it myself, so I can't really help you. If I've understood well, with the later versions of powerbuilder you can use httpclient object instead of msxml.
  1. Helpful
  1. Vladimir K.
  2. Thursday, 31 August 2023 12:15 PM UTC
Good morning Miguel.

Thank you very match.



I know we did try httpclient in the past, but we drop this approach, don't remember exactly, but something either xml structure or/and how is webservice we are calling is build.



But i will go over all your suggestions and try again.



Thank you very match.

Sincerely

Vlad
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.