ommSSL_read: timeout

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
rwillis2916
Posts: 4
Joined: Thu Jul 10, 2025 6:12 pm

ommSSL_read: timeout

Post by rwillis2916 »

I'm trying to call a REST API and the call to http_string gets stuck for about 60 seconds, then it returns error ommSSL_read: timeout. Any ideas if I may be doing something wrong?

I have setup a call to the API via the Postman website and it works fine. So I think I have the parms correct.

The API requires bearer authentication. So I make the call below with UserID blank and field password set to the access token.

http_setAuth( HTTP_AUTH_BEARER
: %trim(Userid)
: %trim(Password) );

I only have one form parm;

form_data = 'include=All';

There's one URL parm of "subscription-key" (I changed the key below for security).

url = 'https://apis-sandbox.paycor.com/v1/lega ... hlmnopqrst';

then I call the API;

response = http_string('POST': url : %trim(form_data) :
'application/x-www-form-urlencoded')

That's where it gets stuck and when it finally returns control to my program field htttpccode = "ommSSL_read: timeout".

I used debug to step into the http_string procedure. It calls http_req with type set to POST.

rc = http_req(Type: URL: *omit: Output: *omit: SendStr: ct );

then it gets stuck on the call to http_persist_req and variable rc = 0 on return.

Here's the values passed to the http_persist_req procedure.

Type POST
comm SPP:D70893993402ACC0
URL https://apis-sandbox.paycor.com/….....
sndFd -1
sndProc SPP:*NULL
SendPtr SPP:E2CE24E5B6016784
SendLen 11
rcvFd -1
rcvProc PRP:D48ABF2F160126C8
global.timeout 60
global.userAgent http-api/1.52
ct application/x-www-form-urlencoded
soapAction null
global.modTime 0001-01-01-00.00.00.000000
sendLen64 ); 0
rwillis2916
Posts: 4
Joined: Thu Jul 10, 2025 6:12 pm

Re: ommSSL_read: timeout

Post by rwillis2916 »

FYI - My HTTPAPI_VERSION = '1.52'

I have http_debug(*on:'/tmp/paycor-diagnostic-log.txt');

But it doesn't create a log file.

I have another RPG program that calls the same website, for another API, but the API doesn't require authentication. It works fine.

I just load the form data;

Code: Select all

form_data =  'grant_type=refresh_token'         
      + '&' + 'refresh_token=' + %Trim(REFRESH) 
      + '&' + 'client_id=' + %Trim(CLIENT_ID)   
      + '&' + 'client_secret=' + %Trim(SECRET); 
Set the URL;

Code: Select all

url = 'https://apis-sandbox.paycor.com/sts/v1/common/token?subscription-key=abcdefghijkl'
And call http_string;

Code: Select all

response = http_string('POST': url : %trim(form_data) :       
                         'application/x-www-form-urlencoded');
this API returns the access token which I'm using in my problem program for authentication. The access token is good for 30 minutes.
rwillis2916
Posts: 4
Joined: Thu Jul 10, 2025 6:12 pm

Re: ommSSL_read: timeout

Post by rwillis2916 »

Correction on my statement "But it doesn't create a log file."

A log file is being created, but it doesn't show much other than the error "CommSSL_read: timeout!". I tried to attach the log file as .txt, but it doesn't allow .txt attachments. So I pasted most of the log as code below. I changed some key values for security.

While debugging, I see that the Refill procedure is called in COMMSSLR4. Refill calls gsk_secure_soc_read which returns a value of 502. Then it gets stuck for 60 seconds on procedure poll. After which it returns a value of 0 and that's when the error is recorded.

If it matters, my iSeries is on v7r5 and I my CUMe PTF level is 24312.

Code: Select all

Common Name: *.paycor.com
Country: US
State/Province: Ohio
Locality: Cincinnati
Org Unit: Paycor, Inc
Issuer CN: Entrust Certification Authority - L1K
Issuer Country: US
Issuer Org: Entrust, Inc.
Issuer Org Unit: (c) 2012 Entrust, Inc. - for authorized use only, OU=See www.entrust.net/legal-terms
Version: 3
not before: 20240827103336
Unknown Field: 10:33:36 27-08-2024
not after: 20250927103335
Unknown Field: 10:33:35 27-09-2025
pub key alg: 1.2.840.113549.1.1.1
signature algorithm: 1.2.840.113549.1.1.11
Unknown Field: 0382010F003082010A0282010100E34DBED5FFF6FCD80DC285FA8C2D3BF4F64B65C3B9F68622D82D4B28808A0C0433F01E55A28876A3C821092BD9407EF00D689AFF55C0E384E49422B9E7D2D3ED169B248049774DBB0C9E1FC529404D3A647B795E4972B004739E78D812E79DAD1A17F88C74EC520727125EEEE98A73831EAF953A697D97A3797A824AE16770AF647FE25267DC0CFA406B711979D64444944901CBF806B0D13604EA8476FB394136A29C935BD6FC985369E4D106ACFC84A8478A62ECF1FEB96150BB20881E3C68BC457D2B7E18D57C45A92155867C19500576EA3288007314BD32E0BB7899885CF477A983AFC4733CC6F0499FFD11A31CA9495F0103A80F6E31ACEEE334EA67230203010001
Unknown Field: 2048
Unknown Field: C367D23966423B29BFC84EEF353E7D84
Unknown Field: 1.2.840.113549.2.5
Unknown Field: 4CB7E5BB09511F7B03283F649BF427D88EBB75A4
Unknown Field: 8D694B56B5380C2582CDF735D6198F4978A6711F55B72620F3E591653C31CA41
Unknown Field: 5
Unknown Field: paycor.com
Unknown Field: *.paycor.com
Unknown Field: 0
Unknown Field: 1.3.6.1.5.5.7.3.2
Unknown Field: 1.3.6.1.5.5.7.3.1
Unknown Field: 2.23.140.1.2.2
Unknown Field: http://crl.entrust.net/level1k.crl
Unknown Field: http://aia.entrust.net/l1k-chain256.cer
Unknown Field: http://ocsp.entrust.net

Protocol Used: TLS Version 1.2
http_persist_req(POST) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(POST): entered
There are 0 cookies in the cache
POST /v1/tenants/400782/employees?subscription-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx HTTP/1.1
Host: apis-sandbox.paycor.com
User-Agent: http-api/1.52
Content-Type: application/x-www-form-urlencoded
Content-Length: 11
Authorization: Bearer 
xxxxxxxxxxxxxxxxxxxxxxx.......................
senddoc(): entered
include=All
recvresp(): entered
SetError() #43: CommSSL_read: timeout!
recvresp(): end with timeout
http_close(): entered
rwillis2916
Posts: 4
Joined: Thu Jul 10, 2025 6:12 pm

Re: ommSSL_read: timeout

Post by rwillis2916 »

I've made some program changes, but I'm still getting error ommSSL_read: timeout.

Here's some of my relevant code.

Code: Select all

userid   = *blanks; 
password = Access;  // Load the access token into the password input field.                
                                                                                           
http_setAuth( HTTP_AUTH_BEARER                                                             
            : %trim(Userid)                                                                
            : %trim(Password) );                                                           
                                                                                           
form_data =  'include=All'; 

http_setOption('local-ccsid': '0');   
http_setOption('network-ccsid': '1208');  
http_setOption('content-type': 'application/x-www-form-urlencoded');
http_setOption('accept': 'application/json');  

url = 'https://apis-sandbox.paycor.com/v1/legalentities/377552/employees?' + 
      'subscription-key=' + %Trim(APIM); // app subscription key  

rc = http_req( 'POST'      
             : url         
             : *omit       
             : response    
             : *omit       
             : form_Data );
Here's the CURL statement that works just fine on the Postman website;

Code: Select all

curl --location --request GET 'https://apis-sandbox.paycor.com/v1/legalentities/377552/employees?subscription-key=<[i]key removed for security'[/i]>' \
--header 'Authorization: Bearer <[i]key removed for security[/i]>' \
--form 'include="All"'
Here's the CURL statement on the Paycor website that allows you to test the API. This works also.

Code: Select all

curl -X 'GET' \
  'https://apis-sandbox.paycor.com/v1/legalentities/377552/employees?include=All' \
  -H 'accept: application/json' \
  -H 'Authorization: bearer <[i]key removed for security[/i]' \
  -H 'Ocp-Apim-Subscription-Key: <key removed for security'
Both CURL statements return a JSON result set. Example;

Code: Select all

{
  "hasMoreResults": false,
  "continuationToken": null,
  "additionalResultsUrl": null,
  "records": [
    {
      "positionData": {
        "jobTitle": "Accountant",
        "jobCode": "CPA",
        "effectiveStartDate": null,
        "effectiveEndDate": null,
        "payGroupId": "f691705f-6792-0000-0000-0000d0c20500",
        "manager": {
          "id": "5d9dcfda-3af4-0000-0000-0000d0c20500",
          "employeeNumber": "78",
          "employee": {
            "id": "5d9dcfda-3af4-0000-0000-0000d0c20500",
            "url": "/v1/employees/5d9dcfda-3af4-0000-0000-0000d0c20500"
          }
        }
      },
Post Reply