Question & Answer
Question
Trying to use a https URL in SYSTOOLS.HTTP* functions in an environment that requires a proxy might fail with a "Connection timed out"
Cause
http.proxy* properties are not used for secure https url's
Answer
In order to use non-secure webservices (http:) these properties have to be set when a proxy has to be used:
create function systools.setProperty(property vargraphic(4096) ccsid 1200, value vargraphic(4096) ccsid 1200) returns vargraphic(4096) ccsid 1200 language java parameter style java external name 'java.lang.System.setProperty';
values(systools.setProperty('http.proxyHost','<proxyhost or ip>'));
values(systools.setProperty('http.proxyPort','<proxyport>');
When the webservice is provided as a secure https: url, these properties have to be set additionally:
https.proxyHost
https.proxyPort
Usually they can be set to the same values as the according http properties.
As GROUP_PTF_CURRENCY is using http functions, the same setup applies to it.
Please note that host authentication (using http(s).proxyUser and proxyPassword) is not supported by the http SQL functions.
However the authentication can be performed before using the http functions with a java program like the attached ProxyAuthenticator.java.
- http.proxyHost
http.proxyPort
create function systools.setProperty(property vargraphic(4096) ccsid 1200, value vargraphic(4096) ccsid 1200) returns vargraphic(4096) ccsid 1200 language java parameter style java external name 'java.lang.System.setProperty';
values(systools.setProperty('http.proxyHost','<proxyhost or ip>'));
values(systools.setProperty('http.proxyPort','<proxyport>');
When the webservice is provided as a secure https: url, these properties have to be set additionally:
https.proxyHost
https.proxyPort
Usually they can be set to the same values as the according http properties.
As GROUP_PTF_CURRENCY is using http functions, the same setup applies to it.
Please note that host authentication (using http(s).proxyUser and proxyPassword) is not supported by the http SQL functions.
However the authentication can be performed before using the http functions with a java program like the attached ProxyAuthenticator.java.
[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Component":"DB2 for IBM i","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"All Editions","Line of Business":{"code":"LOB68","label":"Power HW"}}]
Was this topic helpful?
Document Information
Modified date:
21 November 2024
UID
nas8N1022427