CA-178981: Make the HTTP API work through XenCenter for TLS 1.2 servers

This commit is contained in:
Stephen Turner 2015-08-06 16:39:39 +01:00
parent 9d098948f7
commit 3e38b34437
3 changed files with 7 additions and 5 deletions

View File

@ -131,9 +131,9 @@ namespace CommandLib
null
);
try
{
sslStream.AuthenticateAsClient("");
}
{
sslStream.AuthenticateAsClient("", null, SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12, true);
}
catch (AuthenticationException e){
if (tCLIprotocol.conf.debug) throw e;
tCLIprotocol.dGlobalError("Authentication failed - closing the connection.");

View File

@ -35,6 +35,7 @@ using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Net.Security;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using System.Runtime.Serialization;
@ -358,7 +359,7 @@ namespace XenAPI
{
SslStream sslStream = new SslStream(stream, false,
new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
sslStream.AuthenticateAsClient("");
sslStream.AuthenticateAsClient("", null, SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12, true);
stream = sslStream;
}

View File

@ -37,6 +37,7 @@ using System.Threading;
using System.IO;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using System.Text;
@ -490,7 +491,7 @@ namespace XenOvfTransport
SslStream sslStream = new SslStream(stream, false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
try
{
sslStream.AuthenticateAsClient("");
sslStream.AuthenticateAsClient("", null, SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12, true);
}
catch
{