IBM Support

Changes to GetHTTP and RESTfulAPI functions in Netcool/Impact 7.1.0 FP19

Following an upgrade to Tivoli Netcool/Impact to 7.1.0.19 or later, the GetHTTP function and RESTfulAPI functions behave differently. This article describes known issues and how they can be resolved.
  
In Netcool/Impact 7.1.0.19, the Apache HTTP library was updated from v3.0 to v5.0. A partial rewrite of the GetHTTP function was required to use the newer library. The functions for the RESTful DSA were also modified since they internally use GetHTTP to perform the HTTP requests.


The HTTP request fails with URISynaxException

Symptom:
Starting in Netcool/Impact 7.1.0.19, the GetHTTP function requires URL query parameters to be url or percent encoded when they contain reserved or non-ascii characters. If an illegal character is found, the function returns a URISyntaxException:


java.net.URISyntaxException: Illegal character in query at index 58:
/api/now/v1/table/incident?sysparm_query=cmdb_ciLIABCDEF^incident_state!=7&sysparm_limit=500&sysparm_offset=0

Cause:
The Apache HTTP library was upgraded to the 5.0 release and now requires reserved characters to be url encoded as per the URI specification in RFC 3986.

Resolution:
Use the URLEncode function to encode the string:

Path = "/api/now/v1/table/incident?sysparm_query=" + 
       URLEncode("cmdb_ciLIABCDEF^incident_state!=7") +
       "sysparm_limit=500&sysparm_offset=0";
     
GetHTTP(HTTPHost, HTTPPort, Protocol, Path, ChannelKey, Method, AuthHandlerActionTreeName, FormParameters, FilesToSend, HeadersToSend, HttpProperties);




The HTTP request does not send query parameters

Symptom:
In Netcool/Impact 7.1.0.19, the GetHTTP function and RESTful data source exclude query parameters set by the parameters object.

Example with the GetHTTP function:

FormParameters=NewObject();
FormParameters.size=20;
GetHTTP(HTTPHost, HTTPPort, Protocol, Path, ChannelKey, Method, AuthHandlerActionTreeName, FormParameters, FilesToSend, HeadersToSend, HttpProperties);


Example with the RESTfulAPIGET function:

Config = NewObject();
Param1 = NewObject();
Param1['size'] = Int(20);
Config['params'] = Param1;
var hits = RESTfulAPIGET("ElasticDS","logstash-serverlogs/_search", Config);

In both cases, the size parameter is not added to the query string.

Resolution:
The issue was addressed in fix pack 7.1.020 and interim fix 7.1.0.19 IF7 by APAR IJ26372: CANNOT SET QUERY PARAMETERS WITH THE RESTFUL POLICY FUNCTIONS.



HTTP Requests that use a proxy use the wrong protocol

Symptom:
In Netcool/Impact 7.1.0.19, the GetHTTP function and RESTful data source are reusing the protocol (HTTPS or HTTP) for both the proxy and endpoint connections. If the connection requires separate protocols, for example HTTPS to the proxy and HTTP to the endpoint then the connection fails.

Resolution:
The issue was addressed in fix pack 7.1.020 and interim fix 7.1.0.19 IF7 by APAR IJ26214: HTTP/HTTPS ISSUE DUE TO APACHE HTTPCOMPONENTS CHANGES.



HTTP Requests cannot use TLS v1.0 or v1.1

Symptom:
In Netcool/Impact 7.1.0.19, the RESTful DSA and GetHTTP function creates SSL connections with TLS v1.2 only.

Cause:
The default SSL connection factory in the Apache HTTP library uses TLS v1.2.

Resolution:
The issue was addressed in fix pack 7.1.020 by APAR IJ27949: GETHTTP CANNOT CONNECT USING TLS1.0 OR 1.1.

Note: Starting in Netcool/Impact 7.1.0.22, the security configuration for the Java runtime disables TLS v1.0 and TLS v1.1. For more information, refer to the Setting up SSL communication topic in the product documentation on how to re-enable TLS versions.



The contents of an HTTP request are not encoded as UTF-8

Symptom:
In Netcool/Impact 7.1.0.19, the GetHTTP function and RESTful data source sets the content type encoding to ISO-8859-1 unless a different charset encoding is selected.

Resolution:
The issue was addressed in fix pack 7.1.0.20 by APAR IJ29388: SENDING UTF-8 ENCODED HTTPS REQUESTS DOESN'T WORK. Outgoing requests now prefer UTF-8 encoding by default.


Symptom:
In Netcool/Impact 7.1.0.19, 7.1.0.20 and 7.1.0.21, the GetHTTP function truncate UTF-8 content inside the FormParameters object.

FormParameters=NewObject();
FormParameters.snpi1="حلوان Test"; // UTF8 content
FormParameters.systemid="ibm";
FormParameters.ston="5";
FormParameters.dest_addr="0123457";

GetHTTP(HTTPHost, HTTPPort, Protocol, Path, '', Method, '', FormParameters, null, HeadersToSend, HttpProperties);

When the endpoint receives the query parameters, any parameters with UTF-8 content are truncated.

snpi1 = ???? Test

Resolution:
The issue was addressed in fix pack 7.1.022 by APAR IJ32032: REGRESSION: FORM PARAMETERS ARE NOT SENT AS UTF8 IN GETHTTP.

 

Mutual Authentication no longer works

Symptom:
Mutual Authentication (mTLS) for the GetHTTP function stops working after upgrading to 7.1.0.19 even though the client certificate and keys are configured.

Cause:
In Netcool/Impact 7.1.0.19, the GetHTTP function no longer loads the client keystore (/opt/IBM/tivoli/impact/wlp/usr/servers/NCI/resources/security/key.jks). This can prevent the function from loading the client certificate needed for client or mutual authentication.


Resolution:
The issue was addressed in fix pack 7.1.023 by APAR IJ33969: REGRESSION: GETHTTP FUNCTION NOT LOADING KEY STORE.


HTTP POST Requests are changed to GET requests

Symptom:
In Netcool/Impact 7.1.0.19 and later, sending an HTTP POST request with the GetHTTP or RESTfulAPIPOST functions, the request is converted to an HTTP GET request if the endpoint initially returns a redirect.

Cause:
The redirect handler in the Apache HTTP library v5.0 was changed to conform with RFC 7231 section 6.4.2. If the HTTP POST request encounters an HTTP 301 or 302 redirect code, the request method changes to a GET request before it follows the redirect.

Solution:
The endpoint needs to send an HTTP 307 (temporary redirect) or 308 (permanent redirect) code instead. HTTP agents are obligated to preserve the HTTP POST request for these redirect codes.


Must Gather

To troubleshoot issues with the HTTP request, enable extra logging by adding the following lines to /opt/IBM/tivoli/impact/etc/impactserver.log4j.properties:

logger.gethttp.name = com.micromuse.response.common.parser.functions.GetHTTPFunction
logger.gethttp.level= TRACE
logger.http5.name = org.apache.hc.client5.http
logger.http5.level= DEBUG

Collect the logs by using the bin/nci_collect_logs.sh|bat tool.


Cannot set Content-Length header

Symptom:
In Netcool/Impact 7.1.0.19 and later, the policy ignores the Content-Length header for my outgoing HTTP request.

 
HeadersToSend=NewObject();
HeadersToSend['Content-Length']=Int(0);


Cause:
The GetHTTP function will auto-generate the Content-Length header based on the size of the request body.

Solution:
It should no longer be necessary to set an explicit Content-Length header in the policy. The code can be safely removed from the policy. If you need to send an HTTP request with a zero length body, declare the request body with an empty string.
 
HttpProperties.Content="";



[{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSSHYH","label":"Tivoli Netcool\/Impact"},"ARM Category":[{"code":"a8m500000008ZwIAAU","label":"Impact-\u003EDSA Data Source Adaptor-\u003ERESTful API"},{"code":"a8m500000008ZwmAAE","label":"Impact-\u003EPolicy-\u003EFunction"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.1.0"}]

Document Information

More support for:
Tivoli Netcool/Impact

Component:
Impact->DSA Data Source Adaptor->RESTful API, Impact->Policy->Function

Software version:
7.1.0

Document number:
6491847

Modified date:
28 November 2022

UID

ibm16491847

Manage My Notification Subscriptions