例程:SSL23_GET_SERVER_HELLO:尝试使用代理连接到neo4j服务器时的未知协议

问题描述 投票:0回答:2

我在远程linux服务器上安装了neo4j-server。此服务器使用nginx并具有虚拟主机。这是配置:

server {
    listen 80;
    listen [::]:80;

    server_name neo.mydomain.in.ua;

    access_log /var/log/nginx/neo-browser-access.log;
    error_log /var/log/nginx/neo-browser-error.log;

    location / {
        proxy_pass http://localhost:7474;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

我用它是因为我不能使用端口7474,只有80或8080。

http://neo.mydomain.in.ua/browser/,效果很好,我看到neo4j浏览器。但我无法使用任何客户端连接到数据库(甚至使用控制台客户端)。我懂了:

>> neo4j-client -u neo4j neo.mydomain.in.ua 80
OpenSSL error: 336031996:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
error: Unexpected error

但当我试图使用邮差时,我得到了

>> http://neo.mydomain.in.ua/db/data/

{
    "errors": [
        {
            "code": "Neo.ClientError.Security.Unauthorized",
            "message": "No authentication header supplied."
        }
    ]
}

这意味着我可以访问数据库,但不能访问neo4j-client。我尝试使用基本身份验证登录,它确实有效。

怎么了?

nginx neo4j ssl-certificate nginx-reverse-proxy libneo4j-client
2个回答
1
投票

您需要打开7687端口才能连接Neo4j数据库。

从邮递员连接时,在连接URL中提供身份验证和更改端口到7687。


1
投票

问题解决了。我只是取消注释

dbms.connectors.default_listen_address=0.0.0.0

在我的neo4j.conf中。但奇怪的是,即使这个选项被禁用,我也可以使用邮递员登录neo4j。 \(0_0)/

© www.soinside.com 2019 - 2024. All rights reserved.