-1

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?

4

2 回答 2

2

我不知道有任何跳过验证的选项,但我知道该错误的常见来源是您的证书颁发机构不在 $DLC/certs 中。证书颁发机构的默认列表相当狭窄。

于 2019-06-12T08:12:57.567 回答
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.
于 2020-08-13T18:04:44.473 回答