/scripts/ahub.form.attachments.js
0

Use .Net for Tls1.2

Jul 06, 2017 at 12:47 AM

209

avatar image
Former Member

Good Morning, We need to consume a webservice soap that uses the TLS 1.2 protocol. We are using version 12.6 of PowerBuilder, we created the proxy based WSDL. Attempting to consume this service returns the message "Underlying connection was closed". We believe that the problem is with the version of the protocol, we made several attempts to use versions of .Net but without success. We need help.

Att; Ronaldo Alberton

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

René Ullrich Jul 06, 2017 at 06:05 AM
0

We had the same problem and I have not found a solution with standard powerbuilder. But we have a workaround.

To use TLS 1.2 you need .NET framework version >= 4.5.

Our solution:

- Build C# classes from WSLD (e.g. using WSEWSDL3.EXE)

- Maybe it is already running with this classes. If you want to specify the protocol write your own extension for the service class of the build classes and override the method GetWebRequest. There you can set the SecurityProtocol.

protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest req = (HttpWebRequest)base.GetWebRequest(uri);
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
return (WebRequest)req;
}

- Compile the classes with correct .NET framework (CSC.EXE)

- You can use the assemblies in Powerbuilder as COM. For more information search the web. There are good examples by Bruce Armstrong.

Share
10 |10000 characters needed characters left characters exceeded
Skip to Content