Thanks for your help Randy. I had found that Program.java yesterday after Googling my ass off, but it had failed too. So I revisited it and found that the SDK Command parser was corrupting my password string by dropping one character. So I used ServiceArgs to tray an alternative and all the connections now worked! The connection part is shown below.
public SplunkNAT(Properties pr) {
props = pr;
errLog = Utils.initLogging(props);
ServiceArgs loginArgs = new ServiceArgs();
loginArgs.setUsername(user);
loginArgs.setPassword(auth);
loginArgs.setHost(host);
loginArgs.setPort(port);
loginArgs.setScheme("https");
loginArgs.setSSLSecurityProtocol(SSLSecurityProtocol.TLSv1_2);
System.out.println("Now trying to connect to Splunk using TLSv1.2");
try {
Service.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2);
service = Service.connect(loginArgs);
service.login();
System.out.println("\t Success!");
} catch (RuntimeException re) {
errLog.severe("Unable to make Splunk Service: " + re.getMessage()
+ ExceptionUtils.getStackTrace(re));
}
System.out.println("Installed apps: " + service.getApplications().keySet());
}
-Terry
... View more