Details
-
Bug
-
Resolution: Unresolved
-
Major
-
3.4.8
-
None
-
None
-
Non-prod
-
1
-
SDK40, SDK42
Description
https://couchbase.slack.com/archives/CC6GX1CJJ/p1689145305271009
*While running a N1QL query on non-prod cluster I'm getting the following SSL Error:
(This works fine on prod cluster)*
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> Couchbase.Core.Exceptions.RequestCanceledException: The query was canceled.
---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.
at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)
at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
— End of inner exception stack trace —
at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at Couchbase.Query.QueryClient.ExecuteQuery[T](QueryOptions options, ITypeSerializer serializer, IRequestSpan span)
— End of inner exception stack trace —
at Couchbase.Query.QueryClient.ExecuteQuery[T](QueryOptions options, ITypeSerializer serializer, IRequestSpan span)
at Couchbase.Query.QueryClient.QueryAsync[T](String statement, QueryOptions options)
at Couchbase.Cluster.<>c_DisplayClass35_0`1.<<QueryAsync>g_Func|0>d.MoveNext()
— End of stack trace from previous location —
at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync[T](Func`1 send, IRequest request)
at Couchbase.Cluster.QueryAsync[T](String statement, QueryOptions options)
at CouchbaseDotNetExample_N1qlQuery.Program.Main(String[] args)
at CouchbaseDotNetExample_N1qlQuery.Program.<Main>(String[] args)
----------------------Context Info--------------------------
{"statement":"[
]","clientContextId":"63c26b19-266d-4516-8dd0-116167cd8195","parameters":"{\u0022Named\u0022:{},\u0022Raw\u0022:{},\u0022Positional\u0022:[]}","httpStatus":"RequestTimeout","queryStatus":"fatal","errors":null,"message":null,"retryReasons":null}
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Couchbase.Playground.Serverless.Shared.CodeRunner.Run(String codeExample) in /Users/dazad/Dev/Playground/playground-serverless/dotnet/src/Couchbase.Playground.Serverless.Shared/CodeRunner.cs:line 76
The dotnet code I'm trying to run:
using System;
using System.Threading.Tasks;
using Couchbase;
using Couchbase.Query;
namespace CouchbaseDotNetExample_N1qlQuery
{
class Program
{
static async Task Main(string[] args)
{
var opts = new ClusterOptions().WithCredentials("
", "
{credentials-password}");
opts.ApplyProfile("wan-development");
opts.KvIgnoreRemoteCertificateNameMismatch = true;
opts.HttpIgnoreRemoteCertificateMismatch = true;
var cluster = await Cluster.ConnectAsync("
", opts);
var bucket = await cluster.BucketAsync("
");
var scope = await bucket.ScopeAsync("
");
var query = "SELECT h.name, h.city, h.state FROM hotel h WHERE h.city = 'San Francisco' AND h.state = 'California' LIMIT 5";
var result = await scope.QueryAsync<dynamic>(query);
if (result.MetaData is
)
{
System.Console.WriteLine("Hotel Results:");
await foreach (var row in result.Rows)
{
System.Console.WriteLine($"Hotel:
,
{row.city}");
}
}
await cluster.DisposeAsync();
}
}
}