我需要连接到代理(?)后面的 solr 服务器。在我尝试之后(没什么特别的):
SolrServer server = new HttpSolrServer("https://urltosolr/solr");
try {
SolrPingResponse pingResponse = server.ping();
} catch (SolrServerException e) {
....
}
堆栈跟踪:
org.apache.solr.client.solrj.SolrServerException: IOException occured when talking to server at: https://urltosolr/solr
...
Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
之后我尝试了 HttpSolrServer 的另一个构造函数,但我不知道如何将用户名和密码正确设置到 HttpClient 中。任何人都可以帮忙吗?