0

I am trying to to do a POST to an API endpoint using Openedge. I have installed the ssl certificate of the place i am requesting from but the https request fails, telling me it can't find the ssl certificate of that place (in my /usr/dlc/certs).

"_errors": [
    {
        "_errorMsg": "ERROR condition: Secure Socket Layer (SSL) failure. error code -54:  unable to get local issuer certificate: for 85cf5865.0 in /usr/dlc/certs (9318) (7211)",
        "_errorNum": 9318
    }
]

So, i have resorted to doing an insecure request, like curl does it with the --insecure or wget does it with "no-check-certificate"

I am using the OpenEdge.Net Libraries on OpenEdge 11.6

creds = new Credentials('https://xxxx.com', 'usersname', 'password').
oPayload = NEW JsonObject().
oRequestBody = new String('CustomerReference=xxx&NoOfParcelsToAdd=2'). 

oRequest = RequestBuilder:Post('https://xxxxx.com/endpoint', oRequestBody)// Add credentials to the request 
        :UsingBasicAuthentication(creds) 
        :ContentType('application/x-www-form-urlencoded') 
        :AcceptJson() :Request.

    oResponse = ClientBuilder:Build():Client:Execute(oRequest).

I want to know, for this OpenEdge.Net Libraries is there a tag that i can put in order to skip the checking of the certificate?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
kuhle
  • 193
  • 2
  • 15
  • So try again, install it correctly. You're asking the wrong question. You don't want to make it insecure: you want to make it work, securely. – user207421 Jun 12 '19 at 08:14
  • No, I don't get you. The solution is to install it correctly, and to stop looking for insecure workarounds. You don't want this. You want a correct solution. If you don't want it secure, don't use SSL. – user207421 Jun 12 '19 at 09:44
  • 5
    Please don't make more work for other people by vandalizing your posts. By posting on the Stack Exchange network, you've granted a non-revocable right, under the [CC BY-SA 3.0 license](//creativecommons.org/licenses/by-sa/3.0/), for Stack Exchange to distribute that content (i.e. regardless of your future choices). By Stack Exchange policy, the non-vandalized version of the post is the one which is distributed. Thus, any vandalism will be reverted. If you want to know more about deleting a post please see: [How does deleting work?](//meta.stackexchange.com/q/5221) – Suraj Rao Jun 12 '19 at 11:18
  • 4
    Please don't make more work for other people by vandalizing your posts. By posting on Stack Overflow, you've granted a non-revocable right, under the [CC BY-SA 3.0 license](https://creativecommons.org/licenses/by-sa/3.0) for SO to distribute that content. By SO policy, any vandalism will be reverted. If you want to know more about deleting a post, please read more at [How does deleting work?](https://meta.stackexchange.com/q/5221) – iBug Jun 12 '19 at 11:33

2 Answers2

2

I don't know of any option to skip verification but I do know that a common source of that error is that your certificate authority is not in $DLC/certs. The default list of certificate authorities is fairly narrow.

Tom Bascom
  • 13,405
  • 2
  • 27
  • 33
  • There is also a fairly current thread on community.progress.com about possibly similar problems: https://community.progress.com/community_groups/openedge_general/f/26/t/58433 – Tom Bascom Jun 12 '19 at 12:45
0
USING OpenEdge.Net.HTTP.IHttpClientLibrary.

USING OpenEdge.Net.HTTP.Lib.ClientLibraryBuilder. 
 
DEFINE VARIABLE oLib AS IHttpClientLibrary NO-UNDO. 

oLib = ClientLibraryBuilder:Build()
        :sslVerifyHost(NO)
        :Library.

oHttpClient = ClientBuilder:Build()
              :UsingLibrary(oLib)
              :Client.
Ahmet
  • 7,527
  • 3
  • 23
  • 47
  • Could you please provide some information as to why your answer helps? Providing just code is uninformative – Harry J Aug 13 '20 at 23:57