I faced the same problem when i was trying to access my Splunk enterprise. In order to make it work, please ensure
1. verify whether you use correct management port (default management port is 8089)
2. If you run on Java 8, need to change SSLSecurityPortocol to TLSv1_2
import these classes:
import com.splunk.HttpService;
import com.splunk.SSLSecurityProtocol;
example
HttpService.setSslSecurityProtocol( SSLSecurityProtocol.TLSv1_2 );
Map connectionArgs = new HashMap();
connectionArgs.put("host", "localhost");
connectionArgs.put("username", "admin");
connectionArgs.put("password", "changeme");
connectionArgs.put("port", 8089);
connectionArgs.put("scheme", "https");
Service service = Service.connect(connectionArgs);
... View more