Skip to main content
Gary Rhodes
Participating Frequently
Jul 27, 2026 12:09 PM UTC
Question

Https request suddenly stopped working.

The code below suddenly stopped working. I perform the same request with a curl statement and it works.  does someone see something I should change or add to my request or is universe 11.xx not up to date with modern security?

 

051:       HTTP.METHOD    = "POST"
052:       OUT.URL        = TOKEN.URL:TOKEN.ENDPOINT
053:       VERSION.CODE   = setHTTPDefault('VERSION','1.1')
054:       CTX.TYPE       = ''
055:       MY.RTN.CODE    = createSecurityContext(MY.CONTEXT, CTX.TYPE)
056:       CREATE.CODE    = createSecureRequest(OUT.URL,HTTP.METHOD,HANDLE,MY.CO
NTEXT)
057:       RET1 = setRequestHeader(HANDLE,'Accept','*/*')
058:       RET1 = setRequestHeader(HANDLE,"content-type","application/x-www-form
-urlencoded")
059:       RET1 = setRequestHeader(HANDLE,'HTTP Protocol','HTTP/1.1')
060:       REQUEST.OUT  = 'grant_type=password'
061:       REQUEST.OUT:= '&username=':USERNAME
062:       REQUEST.OUT:= "&password=":USERPW
063: *
064:       stat           = submitRequest(HANDLE,30000,REQUEST.OUT,RESPONSE.HEAD
ERS,RESPONSE.DATA,HTTP.STATUS)

8 replies

Chris Charles
Rocketeer
Jul 27, 2026 12:28 PM UTC

Hi Gary,

Check to see what the value of your MY.RTN.CODE variable is after your call createSecurityContext().

I’m guessing there’s going to be an error.

Your CTX.TYPE variable is blank. Try setting it to TLSv1.2 as the protocol version.

Gary Rhodes
Participating Frequently
Jul 27, 2026 1:11 PM UTC

When CTX.TYPE is blank the type defaults so no error there. I did try TLSv1.2 but that did not work as well. I appreciate your suggestions. Thanks,

Chris Charles
Rocketeer
Jul 27, 2026 1:31 PM UTC

Can you show me your curl command?

You can X out the private info

Gary Rhodes
Participating Frequently
Jul 27, 2026 1:37 PM UTC

This is what I execute that works. I would prefer not doing this. Makes me think I may need to create a subroutine that I will eventually use more and more out of necessity.

 

069: *      STMT = 'curl -v \':CHAR(10)
070: *      STMT:= '-X POST "https://domainname.com/auth/token" \':CHAR(10)
071: *      STMT:= '-H "Accept:*/*" \':CHAR(10)
072: *      STMT:= '-d "':REQUEST.OUT:'"'
073: *      STMTS = "sh -c '":STMT:"'"
074: *      EXECUTE STMTS CAPTURING STUFF

Gary Rhodes
Participating Frequently
Jul 27, 2026 1:44 PM UTC

i added the data here.

069: *      STMT = 'curl -v \':CHAR(10)
070: *      STMT:= '-X POST "https://domainname.com/auth/token" \':CHAR(10)
071: *      STMT:= '-H "Accept:*/*" \':CHAR(10)
072: *      STMT:= '-d "grant_type=password&username=XXXXX&password=XXXXX"’
073: *      STMTS = "sh -c '":STMT:"'"
074: *      EXECUTE STMTS CAPTURING STUFF

Chris Charles
Rocketeer
Jul 27, 2026 1:51 PM UTC

The most evident difference I see is your curl command doesn’t include the content-type header.

But I do see you said “stopped working” which indicates it worked in the past.

Are you getting errors from any of the function calls?

John Jenkins
Participating Frequently
Jul 27, 2026 1:58 PM UTC

I recommend turning on logging on the call and see what the log file procides as a diagnostic trace. It;s usually easy to decipher. 

JJ
Gary Rhodes
Participating Frequently
Jul 27, 2026 2:11 PM UTC

i removed this line and it works. I didn’t think that wouild be the fix.

RET1 = setRequestHeader(HANDLE,'HTTP Protocol','HTTP/1.1')

 

Thanks for the suggestions. It got me to try different things that I did not think would be the cure. this is what is working now

.052:       HTTP.METHOD    = "POST"
053:       OUT.URL        = TOKEN.URL:TOKEN.ENDPOINT
054:       VERSION.CODE   = setHTTPDefault('VERSION','1.1')
055:       CTX.TYPE = ''
056:       MY.RTN.CODE    = createSecurityContext(MY.CONTEXT, CTX.TYPE)
057:       CREATE.CODE    = createSecureRequest(OUT.URL,HTTP.METHOD,HANDLE,MY.CO
NTEXT)
058:       RET1 = setRequestHeader(HANDLE,'Accept','*/*')
059:       RET1 = setRequestHeader(HANDLE,"content-type","application/x-www-form
-urlencoded")
060:       REQUEST.OUT  = 'grant_type=password'
061:       REQUEST.OUT:= '&username=':USERNAME
062:       REQUEST.OUT:= "&password=":USERPW
063: *
064:       stat           = submitRequest(HANDLE,30000,REQUEST.OUT,RESPONSE.HEAD
ERS,RESPONSE.DATA,HTTP.STATUS)