Forum Post: How-to: Set Custom Socket Options (eg -nohostverify) When Using Httpclient

Status
Not open for further replies.
P

Peter Judge

Guest
Following my session at the EMEA PUG Challenge on the new HTTP Client, I've got a couple of questions via email on how to override options on the underlying ABL socket (for example, specifying the -nohostverify option). I thought I'd post a how-to here in case it comes up again. Usually when you create a client using all the default options it looks something like this def var oClient as IHttpClient. def var oReq as IHttpRequest. def var oResp as IHttpResponse. oClient = ClientBuilder:Build() :UsingLibrary(oLib) :Client. oReq = RequestBuilder:Get(' https://www.progress.com') :Request. oResp = oClient:Execute(oReq). The place to provide these socket overrides is in the ClientBuilder and the ClientLibraryBuilder. I've attached some sample code that will shows 3 options for specifying overrides (the -nohostverify option in particular). You can see API doc for the HTTP Client at https://documentation.progress.com/output/oehttpclient/ To verify the connection parameters actually used, enable logging as follows: log-manager:logfile-name = session:temp-dir + 'log-manager.log'. log-manager:logging-level = 5. The important part is the logging level of >= 5. You'll see a line similar to [15/08/14@13:48:22.473-0400] P-010384 T-008916 1 4GL SOCKET CONNECT: -H forms.netsuite.com -S 443 -ssl

Continue reading...
 
Status
Not open for further replies.
Top