简体   繁体   English

Solr 5 SSL和bin / post

[英]Solr 5 SSL and bin/post

I setup Solr 5.4.1 (standard Solr, no SolrCloud/Zookeeper) with SSL following the Solr manual at EnablingSSL under Linux. 我遵循Linux下EnablingSSL上的Solr手册,使用SSL设置了Solr 5.4.1(标准Solr,无SolrCloud / Zookeeper)。

I can successfully connect through a browser and https to the Solr admin page. 我可以通过浏览器和https成功连接到Solr管理员页面。

However, using Solrs bin/post tool is not possible anymore. 但是,无法再使用Solrs装箱/张贴工具。 For instance, below is my small script to delete all documents from a Solr collection called "mycollection": 例如,下面是我的小脚本,该脚本用于删除名为“ mycollection”的Solr集合中的所有文档:

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

I am getting the following Exception: 我收到以下异常:

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

The question is: How can I use the bin/post tool of Solr with SSL enabled? 问题是:如何在启用SSL的情况下使用Solr的bin / post工具?

EDIT: I can get the above operation done with curl, the command below succeeds. 编辑:我可以用curl完成上述操作,下面的命令成功。 However, this question is about getting the post tool from Solr to work with ssl. 但是,这个问题是关于从Solr获得post工具与ssl一起使用的。

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

The tool uses a cURL using "http://.." and not the desired "https://.." - even though you specify HTTPS in the URL-parameter. 即使您在URL参数中指定了HTTPS,该工具也会使用使用“ http:// ..”而不是所需的“ https:// ..”的cURL。 As of the current version, 6.1.0, it is still not possible to do anything about it - as far as I know. 就目前的版本6.1.0而言,就我所知,仍然无法对其进行任何处理。

As Solr doesn't allow to run both HTTP and HTTPS, it is not possible to use the bin/post-tool with SSL. 由于Solr不允许同时运行HTTP和HTTPS,因此无法将bin / post-tool与SSL一起使用。

Possible work-arounds is to use cURL or by using the post.jar, as shown in https://cwiki.apache.org/confluence/display/solr/Enabling+SSL 可能的解决方法是使用cURL或使用post.jar,如https://cwiki.apache.org/confluence/display/solr/Enabling+SSL中所示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM