1

Hello I am trying to connect to a neo4j database with py2neo. This code works so far:

graph = Graph(bolt=True, host='***',
              bolt_port=***,
              http_port=***,
              user='***',
              password='***')

But when I protect my IP address with a password over HTTP then I can't connect and I don't know how to authorize py2neo to connect.

Does anyone know how I can solve this? :)

Edit : When I open the ip in a web browser i need to input a user and a password before i can see the neo4j browser - and I do not now how to input these credentias with py2neo (because it seems that this is my problem)

Stacktrace:

    Traceback (most recent call last):
  File "WebApp35\lib\site-packages\flask\app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "WebApp35\lib\site-packages\flask\app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "WebApp35\lib\site-packages\flask_restful\__init__.py", line 271, in error_router
    return original_handler(e)
  File "WebApp35\lib\site-packages\flask\app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "WebApp35\lib\site-packages\flask\_compat.py", line 32, in reraise
    raise value.with_traceback(tb)
  File "WebApp35\lib\site-packages\flask\app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "WebApp35\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "WebApp35\lib\site-packages\flask_restful\__init__.py", line 271, in error_router
    return original_handler(e)
  File "WebApp35\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "WebApp35\lib\site-packages\flask\_compat.py", line 32, in reraise
    raise value.with_traceback(tb)
  File "WebApp35\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "WebApp35\lib\site-packages\flask\app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "WebApp35\lib\site-packages\flask_restful\__init__.py", line 477, in wrapper
    resp = resource(*args, **kwargs)
  File "WebApp35\lib\site-packages\flask\views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "WebApp35\lib\site-packages\flask_restful\__init__.py", line 587, in dispatch_request
    resp = meth(*args, **kwargs)
  File "app\handlers\nodeHandlers.py", line 70, in get
    return DataManager.get_suggestion(suggestion_string), 201, {
  File "app\adapter\dataManager.py", line 44, in get_suggestion
    return cls.adapter.get_suggestion(suggestion_string)
  File "app\adapter\neoAdapter.py", line 337, in get_suggestion
    for node in cls.cypher.run(query):
  File "WebApp35\lib\site-packages\py2neo\database\__init__.py", line 676, in run
    return self.begin(autocommit=True).run(statement, parameters, **kwparameters)
  File "WebApp35\lib\site-packages\py2neo\database\__init__.py", line 351, in begin
    return self.transaction_class(self, autocommit)
  File "WebApp35\lib\site-packages\py2neo\database\__init__.py", line 1171, in __init__
    self.session = driver.session()
  File "WebApp35\lib\site-packages\py2neo\packages\neo4j\v1\session.py", line 148, in session
    session = Session(self)
  File "WebApp35\lib\site-packages\py2neo\packages\neo4j\v1\session.py", line 461, in __init__
    self.connection = connect(driver.host, driver.port, driver.ssl_context, **driver.config)
  File "WebApp35\lib\site-packages\py2neo\packages\neo4j\v1\connection.py", line 399, in connect
    raise error
py2neo.packages.neo4j.v1.exceptions.ProtocolError: Cannot establish secure connection; [SSL: UNKNOWN_PROTOCOL] unknown protocol (_ssl.c:720)
  • `secure=True` does not work for you? (`Graph(...., secure=True,...)`). See also: http://py2neo.org/v3/database.html#the-graph . Also: http://py2neo.org/v3/database.html#module-py2neo.database.auth (see the `authenticate` function) – cowbert Oct 23 '17 at 17:56
  • @cowbert I tried it but every time I run graph.run({query}) i get an error – Benjamin Feldmann Oct 23 '17 at 18:27
  • please update your post with what you tried and the error(s) you received. – cowbert Oct 23 '17 at 18:42
  • The exact error message would be useful as well as how exactly you're doing *But when I protect my IP address with a password over HTTP* - I'm not quite sure how to interpret that... – Jon Clements Oct 23 '17 at 18:49
  • 1
    This error is showing that the driver cannot parse the SSL response. Make sure the ports you're connecting to actually support HTTPS and not just plain HTTP (are you connecting to the correct secure ports?) – cowbert Oct 28 '17 at 16:32

0 Answers0