Solr 5 SSL and bin/post



我按照Linux下EnablingSSL的Solr手册设置了Solr 5.4.1(标准Solr,没有SolrCloud/Zookeeper)。

我可以通过浏览器和https成功连接到Solr管理页面。

但是,不再可能使用Solrs箱/发布工具。例如,下面是我的小脚本,用于从名为"mycollection"的Solr集合中删除所有文档:

bin/post -url https://localhost:8983/solr/mycollection/update -d "<delete><query>*:*</query></delete>"

我收到以下异常:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

问题是:如何在启用SSL的情况下使用Solr的bin/post工具?

编辑:我可以使用curl完成上述操作,以下命令成功。但是,这个问题是关于从Solr获取后期工具以使用SSL。

curl -k https://localhost:8983/solr/mycollection/update?commit=true -H Content-Type: text/xml --data-binary '<delete><query>*:*</query></delete>'

该工具使用使用"http://.."而不是所需的"https://..."的cURL - 即使您在URL参数中指定了HTTPS。截至当前版本6.1.0,据我所知,仍然无法对此做任何事情。

由于Solr不允许同时运行HTTP和HTTPS,因此无法将bin/post-tool与SSL一起使用。

可能的解决方法是使用 cURL 或使用 post.jar,如https://cwiki.apache.org/confluence/display/solr/Enabling+SSL

最新更新