Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit e6d9745

Browse files
authored
Merge pull request #764 from justcoding121/master
stable
2 parents 35edb89 + 0052e4a commit e6d9745

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs

+26-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,32 @@ private async Task<TcpServerConnection> createServerConnection(string remoteHost
546546
stream?.Dispose();
547547
tcpServerSocket?.Close();
548548

549-
enabledSslProtocols = SslProtocols.Tls;
549+
// Specifying Tls11 and/or Tls12 will disable the usage of Ssl3, even if it has been included.
550+
// https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.tcptransportsecurity.sslprotocols?view=dotnet-plat-ext-3.1
551+
enabledSslProtocols = proxyServer.SupportedSslProtocols & (SslProtocols)0xff;
552+
553+
if (enabledSslProtocols == SslProtocols.None)
554+
{
555+
throw;
556+
}
557+
558+
retry = false;
559+
goto retry;
560+
}
561+
catch (AuthenticationException ex) when (ex.HResult == unchecked((int)0x80131501) && retry && enabledSslProtocols >= SslProtocols.Tls11)
562+
{
563+
stream?.Dispose();
564+
tcpServerSocket?.Close();
565+
566+
// Specifying Tls11 and/or Tls12 will disable the usage of Ssl3, even if it has been included.
567+
// https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.tcptransportsecurity.sslprotocols?view=dotnet-plat-ext-3.1
568+
enabledSslProtocols = proxyServer.SupportedSslProtocols & (SslProtocols)0xff;
569+
570+
if (enabledSslProtocols == SslProtocols.None)
571+
{
572+
throw;
573+
}
574+
550575
retry = false;
551576
goto retry;
552577
}

0 commit comments

Comments
 (0)