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
I am getting the same issue and even after using the above line of code the problem is not solved.
I am using the remote server address to connect to Splunk using Java1.8 and Splunk jar version 1.6.2 with the below code.
HttpService.setSslSecurityProtocol( SSLSecurityProtocol.TLSv1_2 );
ServiceArgs serviceArgs = new ServiceArgs();
serviceArgs.setUsername("Username");
serviceArgs.setPassword("Password");
serviceArgs.setHost("http://mycompanySplunkServer.com");
serviceArgs.setPort(8089);
service = Service.connect(serviceArgs);
... View more