I tried the following and it worked for me
HttpService.setSslSecurityProtocol( SSLSecurityProtocol.TLSv1_2 );
ServiceArgs serviceArgs = new ServiceArgs();
serviceArgs.setHost("mycompanySplunkServer.com");
serviceArgs.setPort(8089);
// Create a Service instance and log in with the argument map
Service service = Service.connect(serviceArgs);
service.login("MyUsername","MyPassword");
System.out.println(service.getToken().toString());
... View more