使用 Gremlin.net 从本地 Windows 计算机连接到 AWS Neptune

Avn*_*evy 2 gremlin amazon-neptune gremlinnet

我在access-graph-gremlin-dotnet 上关注 Amazon 的文档, 并尝试在本地 Windows 机器上运行它,该机器通过 EC2 实例通过 SSH 隧道连接到 Neptune。
我已经使用 gremlin 控制台测试了 SSH 隧道,它工作正常。
在 EC2 实例上运行该程序也可以,但是在本地 Windows 机器上运行该程序时,我收到以下异常,因为需要将 Neptune 的证书添加到受信任的证书中:

System.Net.WebSockets.WebSocketException (0x80004005): Unable to connect to the remote server ---> 
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner 
 exception. ---> System.Security.Authentication.AuthenticationException: The remote certificate is 
invalid according to the validation procedure.
Run Code Online (Sandbox Code Playgroud)

我正在寻找如何在 Gremlin.Net 3.4.6(首选 C#)中执行此操作。

小智 5

你需要这样做:

  1. 以管理员身份打开 cmd.exe
  2. notepad c:\windows\system32\drivers\hosts
  3. 添加一行 127.0.0.1 <your neptune cluster endpoint just the name without port>
  4. 保存文件
  5. 现在再次尝试运行 .Net 代码

这是因为您最有可能连接到localhost集群的主机名并且证书已签名,因此存在不匹配。