当尝试使用url时,我得到的URI不能为空
下面是我的代码,
HttpService.setSslSecurityProtocol(SSLSecurityProtocol.SSLv3);
//Tried the below one also
//HttpService.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2);
ServiceArgs loginArgs = new ServiceArgs();
loginArgs.setUsername("username");
loginArgs.setPassword("password");
loginArgs.setHost("my splunk url"); //for eg http://splunkdet.mysite.com:8000/login
loginArgs.setPort(8000);
Service service = Service.connect(loginArgs);
for (Application app: service.getApplications().values()) {
System.out.println(app.getName());
}获取异常"URI不能为空“Service service = Service.connect(loginArgs);
我的密码怎么了?
发布于 2020-11-05 17:03:38
由于您使用的是http而不是https,所以不需要使用HttpService.setSslSecurityProtocol。
相反,将该方案添加到您的ServiceArgs示例: loginArgs.setScheme("http");
不要在传递给setHost的URL中包括http://或https://。
https://stackoverflow.com/questions/48405893
复制相似问题