Skip to content

Is it possible to connect to https website with self signed ssl cert? #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cryptid11 opened this issue Jul 22, 2015 · 1 comment
Open

Comments

@cryptid11
Copy link

If yes how?

I see here https://github.com/edsu/solrpy/blob/ae72fb90b100090328aab1949ba978b1717795f5/solr/core.py#L52 it seems possible but I take the ssl_key it seems, anyway I export what is seems the ssl_cert an put it into a file, it's like

-----BEGIN TRUSTED CERTIFICATE-----
MIID4TCCAsmgAwIBAgIOYyUAAQACFJ0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezEL
.....
dXN0Q2VudGVyIFVuaXZlcnNhbCBYQSBJSUk=
-----END TRUSTED CERTIFICATE-----

but don't know hot to set the key?

Is there a way to simply ignore the initial warning and go on? I got

Traceback (most recent call last):
  File "solr1.py", line 36, in <module>
    response = s.query("directQuota_ss:*")
  File "build/bdist.linux-x86_64/egg/solr/core.py", line 703, in query
  File "build/bdist.linux-x86_64/egg/solr/core.py", line 798, in __call__
  File "build/bdist.linux-x86_64/egg/solr/core.py", line 822, in raw
  File "build/bdist.linux-x86_64/egg/solr/core.py", line 646, in _post
  File "build/bdist.linux-x86_64/egg/solr/core.py", line 625, in _reconnect
  File "/usr/lib64/python2.7/httplib.py", line 1274, in connect
    server_hostname=server_hostname)
  File "/usr/lib64/python2.7/ssl.py", line 352, in wrap_socket
    _context=self)
  File "/usr/lib64/python2.7/ssl.py", line 579, in __init__
    self.do_handshake()
  File "/usr/lib64/python2.7/ssl.py", line 808, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

with the standard:
s = solr.SolrConnection('https://IP_ADDRESS/solr/SOME_INDEX')

Any solution?

I also try

import requests
import requests.packages.urllib3
requests.packages.urllib3.disable_warnings()

and

import httplib2
h = httplib2.Http(".cache", disable_ssl_certificate_validation=True)

without results...

@cryptid11 cryptid11 changed the title is it possible to connect to https website with self signed ssl cert? Is it possible to connect to https website with self signed ssl cert? Jul 22, 2015
@search5
Copy link
Owner

search5 commented Oct 11, 2018

Is it possible to communicate with Solar running under HTTPS? Or will you send me a PR?

If you need to use a self-signed key, consider a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants