Skip to content

Commit

Permalink
Ignore self signed.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Mar 29, 2021
1 parent 3519714 commit 6f592b1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cli/Squidex.CLI/Squidex.CLI/Commands/App_Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public sealed class AddArguments : IArgumentModel
[Option(LongName = "create", ShortName = "c", Description = "Create the app if it does not exist (needs admin client)")]
public bool Create { get; set; }

[Option(LongName = "ignore-self-signed", ShortName = "i", Description = "Ignores self signed certificates")]
public bool IgnoreSelfSigned { get; set; }

public string ToEntryName()
{
return !string.IsNullOrWhiteSpace(Label) ? Label : Name;
Expand All @@ -161,6 +164,7 @@ public ConfiguredApp ToModel()
Name = Name,
ClientId = ClientId,
ClientSecret = ClientSecret,
IgnoreSelfSigned = IgnoreSelfSigned,
ServiceUrl = ServiceUrl
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Newtonsoft.Json;
using Squidex.CLI.Commands.Implementation;
using Squidex.ClientLibrary;
using Squidex.ClientLibrary.Configuration;

namespace Squidex.CLI.Configuration
{
Expand Down Expand Up @@ -162,13 +163,20 @@ public ISession StartSession()

private static SquidexOptions CreateOptions(ConfiguredApp app)
{
return new SquidexOptions
var options = new SquidexOptions
{
AppName = app.Name,
ClientId = app.ClientId,
ClientSecret = app.ClientSecret,
Url = app.ServiceUrl
};

if (app.IgnoreSelfSigned)
{
options.Configurator = AcceptAllCertificatesConfigurator.Instance;
}

return options;
}

public Configuration GetConfiguration()
Expand Down
2 changes: 2 additions & 0 deletions cli/Squidex.CLI/Squidex.CLI/Configuration/ConfiguredApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ public sealed class ConfiguredApp
public string ClientSecret { get; set; }

public string Name { get; set; }

public bool IgnoreSelfSigned { get; set; }
}
}
2 changes: 1 addition & 1 deletion cli/Squidex.CLI/Squidex.CLI/Squidex.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<TargetFramework>net5.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<ToolCommandName>sq</ToolCommandName>
<Version>7.1</Version>
<Version>7.2</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommandDotNet" Version="4.1.6" />
Expand Down

0 comments on commit 6f592b1

Please sign in to comment.