Hi i was trying to use solrj to query in https protocol but i am getting ssl exection error. here are the code same i tried import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.impl.HttpSolrServer; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.SolrDocumentList; import java.net.MalformedURLException; public class SolrJSearcher { public static void main(String[] args) throws MalformedURLException, SolrServerException { HttpSolrServer solr = new HttpSolrServer("`https://abc:8080/solr`"); SolrQuery query = new SolrQuery(); query.setQuery("sony digital camera"); query.addFilterQuery("cat:electronics","store:amazon.com"); query.setFields("id","price","merchant","cat","store"); query.setStart(0); query.set("defType", "edismax"); QueryResponse response = solr.query(query); SolrDocumentList results = response.getResults(); for (int i = 0; i < results.size(); ++i) { System.out.println(results.get(i)); } } } and i got following expection Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:無法 找到com.sun.net.ssl.internal.ssl.Alerts有效的認證路徑請求的目標 。 getSSLException(Alerts.java:174) 在com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1762) 在com.sun.net.ssl.internal.ssl.Handshaker.fatalSE( Handshaker.java:241) at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:235) at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker。 Java的:1206) at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:136) at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593) at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529) 在com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:958) 在COM。 sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1203) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1230) at com.sun。 net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1214) at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:571) at org.apache.http.conn。 ssl.SSLSocketF actory.connectSocket(SSLSocketFactory.java:402) at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:494) at org.apache.http.conn.scheme.SchemeSocketFactoryAdaptor.connectSocket(SchemeSocketFactoryAdaptor。的java:65) 在org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:179) 在org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144) 在org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:131) at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:609) at org.apache.http。 impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:444) at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:864) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at org.apache.http .impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57) at solrcheck.SolrJSearcher.main(SolrJSearcher.java:87 ) 引起:sun.security.validator.ValidatorException:PKIX路徑構建失敗: sun.security.provider.certpath.SunCertPathBuilderException:無法到 在sun.security.validator.PKIXValidator.doBuild找到請求目標 的有效證書路徑(PKIXValidator.java:323) 在sun.security。 validator.PKIXValidator.engineValidate(PKIXValidator.java:217) at sun.security.validator.Validator.validate(Validator.java:218) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl。 java:126) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java: 249) at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1185) ... 21更多 引起:sun.security.provider.certpath.SunCertPathBuilderException:無法發現 查找在sun.security.provider有效的認證路徑請求的目標 。(SunCertPathBuilder.java:174) at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238) at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:318) 。 .. 27多個Solrj查詢在https協議錯誤
any working example will be great help. thanks .
0
A
回答
1
HttpSolrServer使用HttpClient的,您可能需要提供SSL HttpClient的,如在http://hc.apache.org/httpclient-3.x/sslguide.html
SolrServer solrServer = new HttpSolrServer(url, httpclient);
記錄了一些相關主題的
相關問題
- 1. HTTPS協議錯誤(ASP.NET MVC)
- 2. solrj錯誤執行查詢
- 3. HTTP和HTTPS協議
- 4. HTTPS協議塊JS
- 5. 強制https協議
- 6. PHP - 在檢測HTTPS協議
- 7. SSL協議錯誤
- 8. 錯誤在協議聲明
- 9. SolrJ查詢
- 10. 在android上使用HTTPS連接發生未知協議錯誤
- 11. SolrJ查詢,連接查詢
- 12. webrequest.GetResponse https拋出錯誤403在Windows 2008上的協議錯誤2008 x64
- 13. HTTPS協議重定向Rails
- 14. 的Youtube API HTTPS協議
- 15. 返回HTTP/HTTPS協議
- 16. 用的mod_pagespeed HTTPS協議
- 17. 的link_to有:協議HTTPS
- 18. Jenkins SVN使用https協議
- 19. Solrj查詢響應
- 20. Solrj查詢限制
- 21. Chrome中的HTTPS服務器「不支持的協議錯誤」
- 22. 節點js錯誤:不支持協議「https:」。預計「http:」
- 23. Codeigniter使用https協議的file_get_content()錯誤權限
- 24. 捲曲錯誤1:不支持協議:HTTPS
- 25. Nodejs錯誤:不支持協議「http:」。預期的「https:」
- 26. 不符合協議錯誤
- 27. jquery交叉協議錯誤
- 28. 協議緩衝區錯誤
- 29. 錯誤「SSL23_GET_SERVER_HELLO:未知協議」
- 30. 使用錯誤協議