Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,16 @@ protected override void Load(ContainerBuilder builder)
halibutTimeoutsAndLimits.TcpNoDelay = useTcpNoDelay;
halibutTimeoutsAndLimits.UseAsyncListener = useAsyncListener;

ISslConfigurationProvider sslConfigurationProvider = EnvironmentOverrides.UseLegacyExplicitSslConfiguration
? new LegacySslConfigurationProvider()
: new DefaultSslConfigurationProvider();

var halibutRuntime = new HalibutRuntimeBuilder()
.WithServiceFactory(services)
.WithServerCertificate(configuration.TentacleCertificate!)
.WithMessageSerializer(serializerBuilder => serializerBuilder.WithLegacyContractSupport())
.WithHalibutTimeoutsAndLimits(halibutTimeoutsAndLimits)
.WithSslConfigurationProvider(new LegacySslConfigurationProvider())
.WithSslConfigurationProvider(sslConfigurationProvider)
.Build();

halibutRuntime.SetFriendlyHtmlPageContent(FriendlyHtmlPageContent);
Expand Down
10 changes: 10 additions & 0 deletions source/Octopus.Tentacle/EnvironmentOverrides.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;

namespace Octopus.Tentacle
{
public static class EnvironmentOverrides
{
public static bool UseLegacyExplicitSslConfiguration =>
Environment.GetEnvironmentVariable("OCTOPUS_TENTACLE_USE_LEGACY_TLS") == "YES";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the value for this be TRUE rather than YES, as it should follow the standard bool convention?

}
}
11 changes: 7 additions & 4 deletions source/Octopus.Tentacle/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ public Program(string[] commandLineArguments) : base("Octopus Deploy: Tentacle",
OctopusTentacle.EnvironmentInformation,
commandLineArguments)
{
ServicePointManager.SecurityProtocol =
SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
if (EnvironmentOverrides.UseLegacyExplicitSslConfiguration)
{
ServicePointManager.SecurityProtocol =
SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;
}
}

protected override ApplicationName ApplicationName => ApplicationName.Tentacle;
Expand Down