0

I have deployed Gremlin.NET to Pivotal Cloudfoundry but the requests fail with "Unable to connect to the remote server". I suspect this is a cert issue. I see the Java implementation has a way to specify certs in the Cluster connection, but do not see an equivalent in the Gremlin.NET implementation.

The same code works properly on my local box (Windows). The only difference I can see is deployment to PCF and possibly trust issues?

Thanks

UPDATE:

The Java-based version works for us in PCF. We suspect because we are specifying the certs explicitly via keyfile, keyCertChainFile, and trustCertificateChainFile.

Coworker was able to repro this. Sorry for the delay, we had a release between then and now and I was unable to get this data. Stack Trace:

{System.Net.WebSockets.WebSocketException (0x80004005): Unable to connect to the remote server ---> System.Net.WebSockets.WebSocketException (0x80004005):   Unable to connect to the remote server ---> System.Net.Http.WinHttpException (0x80072F8F): A security error occurred at  
 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at System.Net.WebSockets.WinHttpWebSocket.<ConnectAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.WebSockets.WebSocketHandle.<ConnectAsyncCore>d__20.MoveNext()
at System.Net.WebSockets.WebSocketHandle.<ConnectAsyncCore>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() a
t System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.WebSockets.ClientWebSocket.<ConnectAsyncCore>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Gremlin.Net.Driver.WebSocketConnection.<ConnectAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Gremlin.Net.Driver.Connection.<ConnectAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Gremlin.Net.Driver.ConnectionPool.<CreateNewConnectionAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Gremlin.Net.Driver.ConnectionPool.<GetAvailableConnectionAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Gremlin.Net.Driver.GremlinClient.<SubmitAsync>d__61.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Gremlin.Net.Driver.Remote.DriverRemoteConnection.<SubmitBytecodeAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Gremlin.Net.Driver.Remote.DriverRemoteConnection.<SubmitAsync>d__42.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Gremlin.Net.Process.Remote.RemoteStrategy.<ApplyAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Gremlin.Net.Process.Utils.WaitUnwrap(Task task)
at Gremlin.Net.Process.Traversal.DefaultTraversal2.ApplyStrategies()
at Gremlin.Net.Process.Traversal.DefaultTraversal2.GetTraverserEnumerator()
at Gremlin.Net.Process.Traversal.DefaultTraversal2.get_TraverserEnumerator()
at Gremlin.Net.Process.Traversal.DefaultTraversal2.MoveNext()
at Gremlin.Net.Process.Traversal.DefaultTraversal2.Next()
at grem_net_test.gremlinService.GetCount() in C:\cWorkbench\grem-net-test\gremlinService.cs:line 25
at gremlin_net_test.Controllers.ValuesController.GetString() in C:\cWorkbench\grem-net-test\Controllers\ValuesController.cs:line 52
at lambda_method(Closure , Object , Object[] )
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext()}
Bryce
  • 45
  • 1
  • 7
  • Could you share the stack trace you are getting and logs from the server (when there are any related to this)? Can you connect with any other client to the server you deployed there, e.g, with the Gremlin Console? – Florian Hockmann Jun 14 '18 at 16:59
  • We had to move to a different solution so I was not able to repro this until now. My coworker produced a stack trace using it on his machine. In PCF we have the java driver running successfully but we added the cert info programmatically (keyfile, keyCertChainFile, trustCertificateChainFile). – Bryce Jul 12 '18 at 20:17
  • This seems to be caused by a TLS/SSL certificate from the server that is not trusted by the client. Could you try to add the certificate used on the server to the local certificate storage of the machine on which Gremlin.Net is used? That way the certificate should be trusted and Gremlin.Net should be able to connect to the server. – Florian Hockmann Jul 18 '18 at 16:10
  • Good morning, thanks for the tip. I followed CloudFoundtry's docs on adding the cert to my manifest but am still not getting it to connect. New error though: "The remote certificate is invalid according to the validation procedure." So now I am thinking of trying to bypass cert validation in .net core as this is pointing to an internal company server. Not sure if I can do that via callback in .net core. Researching. Thanks again. – Bryce Sep 27 '18 at 14:31
  • 1
    Future versions of Gremlin.Net will allow you to configure the `ClientWebSocketOptions` which includes the `RemoteCertificateValidationCallback` starting with .NET Core 2.1. That should solve your problem. The ticket [TINKERPOP-2015](https://issues.apache.org/jira/browse/TINKERPOP-2015) contains more information. – Florian Hockmann Oct 01 '18 at 11:39

0 Answers0