Hi all.
Does anyone has a sample program that demonstrate how to
submit a http request over secured connection?
I was able to write a program to submit SOAP requests over regular HTTP
connection but when I modify it to use secured connection it failed.
Without going into the detail of the SOAP XML, below is a listing of
functions calls used by my test programs:
Program 1 for regular HTTP:
Ret = setHTTPDefault("VERSION", "1.1")
Ret = setHTTPDefault("HEADERS", '')
Ret = createRequest(URL, "POST", HTTPReq)
Ret = setRequestHeader(HTTPReq, 'Conten-Type', 'text/xml; charset=utf-8')
Ret = setRequestHeader(HTTPReq, 'Content-Length', LEN(POST_DATA))
Ret = setRequestHeader(HTTPReq, 'SOAPAction', QUOTE(SOAPAction))
Ret = submitRequest(HTTPReq, Timeout, POST_DATA, RESPONSE_HEADER,
RESPONSE_DATA, HTTP_STATUS)
Program 2 for secured HTTP:
Ret = setHTTPDefault("VERSION", "1.1")
Ret = setHTTPDefault("HEADERS", '')
Ret = createSecurityContext(SecurityContext, "TLSv1")
Ret = createSecureRequest(URL, 'POST', HTTPReq, SecurityContext)
Ret = setRequestHeader(HTTPReq, 'Conten-Type', 'text/xml; charset=utf-8')
Ret = setRequestHeader(HTTPReq, 'Content-Length', LEN(POST_DATA))
Ret = setRequestHeader(HTTPReq, 'SOAPAction', QUOTE(SOAPAction))
Ret = submitRequest(HTTPReq, Timeout, POST_DATA, RESPONSE_HEADER,
RESPONSE_DATA, HTTP_STATUS)
As you can see, the second program for secured HTTP conection
added a call to "createSecurityContext" and replaced "createRequest" with
"createSecureRequest". However, the first program works but the second
program does not. The "submitRequest" call in the second program returns
status code 3 which indicates network error.
I don't think I need to deal with security certificates or authentication
rules because IBM Universe's documentation indicates that submiting requests
as a client does not require certificate or authentication (unless the
server requires certificates for handshakes) and the default setting has
authentication set to off.
It would be appreciated if anyone can point me in the right direction to
get my program working.
Thank you.
Jason
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/