使用密码保护的http协议通过py2neo连接到neo4j

时间:2017-10-23 17:48:38

标签: python http neo4j py2neo

您好我正在尝试使用neo4j连接到py2neo数据库。 此代码到目前为止起作用:

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

但是,当我使用HTTP密码保护我的IP地址时,我无法连接,而且我也不知道如何授权py2neo进行连接。

有谁知道如何解决这个问题? :)

编辑: 当我在网络浏览器中打开ip时,我需要输入用户和密码才能看到neo4j浏览器 - 我现在不知道如何用py2neo输入这些凭证(因为这似乎是我的问题)

堆栈跟踪:

    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)

0 个答案:

没有答案