[SOLVED] CLI --ignore-self-signed

I have…

  • [x] Checked the logs and have uploaded a log file and provided a link because I found something suspicious there. Please do not post the log file in the topic because very often something important is missing.

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [x] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

CLI do not work with untrusted SSL with set parameter -i

I have suspicion that Squidex.ClientLibrary.Configuration.Authenticator do not respect this parameter and even if HttpClient which are uses to access squidex API do.

Expected behavior

--ignore-self-signed should work.

Environment

  • [x] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: 5.6.0

Error

Executing the following steps
* STEP 0 of 6: Assets
* STEP 1 of 6: Schemas
* STEP 2 of 6: App
* STEP 3 of 6: contents
* STEP 4 of 6: Rules
* STEP 5 of 6: Workflow

--------------------------------------------------------
* STEP 0 of 6: Exporting Assets started

ERROR: 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: RemoteCertificateNameMismatch, RemoteCertificateChainErrors
   at System.Net.Security.SslStream.SendAuthResetSignal(ProtocolToken message, ExceptionDispatchInfo exception)
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Boolean async, Stream stream, SslClientAuthenticationOptions sslOptions, 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.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
   at Squidex.ClientLibrary.Configuration.Authenticator.GetBearerTokenAsync()
   at Squidex.ClientLibrary.Configuration.CachingAuthenticator.GetBearerTokenAsync()
   at Squidex.ClientLibrary.Utils.AuthenticatingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
   at Squidex.ClientLibrary.Management.AssetsClient.GetAssetsAsync(String app, Nullable`1 top, Nullable`1 skip, String orderby, String filter, String parentId, String idsQuery, String qQuery, CancellationToken cancellationToken)
   at Squidex.ClientLibrary.Management.AssetsClient.GetAllAsync(String app, Func`2 callback, Int32 batchSize, CancellationToken cancellationToken)
   at Squidex.CLI.Commands.Implementation.Sync.Assets.AssetsSynchronizer.ExportAsync(DirectoryInfo directoryInfo, JsonHelper jsonHelper, SyncOptions options, ISession session)
   at Squidex.CLI.Commands.Implementation.Sync.Synchronizer.<>c__DisplayClass4_0.<<ExportAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Squidex.CLI.Commands.Implementation.Sync.Extensions.Foreach[T](IEnumerable`1 source, Func`3 action)
   at Squidex.CLI.Commands.Implementation.Sync.Synchronizer.ExportAsync(String path, SyncOptions options, ISession session)
   at Squidex.CLI.Commands.App.Sync.Out(OutArguments arguments)
   at CommandDotNet.Execution.InvocationResultExtensions.GetResultCodeAsync(Object value)
   at CommandDotNet.AppRunner.HandleException(Exception ex, IConsole console, CommandContext commandContext)
   at CommandDotNet.AppRunner.Run(String[] args)
   at Squidex.CLI.Program.Main(String[] args)

I can have a look. But it would be great if you test it yourself and provide a PR.

PR provided. Work on my machine.

1 Like

I have commented it.

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.