添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
要出家的灌汤包  ·  kube_pod_container_sta ...·  2 月前    · 
健身的键盘  ·  JetPack SDK 6.0 DP | ...·  3 月前    · 
不敢表白的钱包  ·  Building a Vert.x ...·  3 月前    · 
冲动的弓箭  ·  ROG Flow Z13 (2023) | ...·  4 月前    · 
Posted by 302218 on 16-Sep-2016 07:46

I need to add TLS 1.2 to the C# ServicePointManager:SecurityProtocol property.

This is the c# code looks rather simple:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

But I need to do from the ABL. How would I translate this in ABL code?

Maybe I don't see the obvious but I can only set the property to exactly one value:

assign ServicePointManager:SecurityProtocol = SecurityProtocolType:Tls11.



Thanks in Advance and Best Regards, Richard.

OpenEdge Development - Forum
Posted by Peter Judge on 16-Sep-2016 08:08
Which version of OE? In 11.6 the AND and OR keywords are overloaded to be bitwise operators for enums (as those are).
Before that, you have to use the Progress.Util.EnumHelper class.
Posted by Peter Judge on 16-Sep-2016 08:08
Which version of OE? In 11.6 the AND and OR keywords are overloaded to be bitwise operators for enums (as those are).
Before that, you have to use the Progress.Util.EnumHelper class.
Posted by 302218 on 19-Sep-2016 04:03

Thanks to all that have answered. This is the code I've come up with and works without a fuzz:

define variable enumHelper1       as class System.Enum        no-undo.
define variable enumHelper2       as class System.Enum        no-undo.

assign enumHelper1 = Progress.Util.EnumHelper:or ( SecurityProtocolType:Tls, SecurityProtocolType:Tls11 ).

assign enumHelper2 = Progress.Util.EnumHelper:or ( cast ( enumHelper1, SecurityProtocolType ), SecurityProtocolType:Tls12 ).

assign ServicePointManager:SecurityProtocol = cast ( enumHelper2, SecurityProtocolType ).

Of course this works only with .NET 4.5 ( TLS 1.2 support ) ...

Thanks!

Progress, Telerik, Ipswitch and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.

Privacy Center License Agreement