Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So I was trying out the new TLS support starting RethinkDB with a command like so:

rethinkdb --http-tls-key key.pem --http-tls-cert cert.pem --driver-tls-key key.pem --driver-tls-cert cert.pem

and the web ui goes to https successfully, but it looks like I need to change something for the Python driver:

In [1]: import rethinkdb as r

In [2]: r.connect("localhost", 28015).repl() --------------------------------------------------------------------------- ReqlDriverError Traceback (most recent call last) <ipython-input-2-655078830678> in <module>() ----> 1 r.connect("localhost", 28015).repl()

.../site-packages/rethinkdb/net.pyc in __init__(self, parent, timeout) 313 .replace('receiving from', 'during handshake with')\ 314 .replace('sending to', 'during handshake with') --> 315 raise ReqlDriverError(error) 316 except socket.timeout as ex: 317 self.close()

ReqlDriverError: Connection is closed.



You need to pass the ssl certification to `connect` for the driver to successfully connect to an encrypted port. Check out the docs here: http://rethinkdb.com/api/python/connect/

EDIT: also, we'll modify the docs to make that more clear (see https://github.com/rethinkdb/docs/issues/1076)


Thanks. That fixed me up:

In [6]: r.connect(host="localhost", port=28015, password="", ssl={"ca_certs": "./cert.pem"}).repl() Out[6]: <rethinkdb.net.DefaultConnection at 0x7f92ea759fd0>


You'll need to pass the a certificate to `connect` through the `ssl` option, see http://www.rethinkdb.com/api/python/connect/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: