SEBWIN-226: Removed client initialization operation, as it appears that manually setting the security protocols is not required with .NET version 4.7.2.
This commit is contained in:
parent
370ea54116
commit
5e4b0b0bc7
7 changed files with 0 additions and 108 deletions
|
@ -1,51 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
|
|
||||||
*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
using System.Net;
|
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
||||||
using Moq;
|
|
||||||
using SafeExamBrowser.Client.Operations;
|
|
||||||
using SafeExamBrowser.Contracts.Core.OperationModel;
|
|
||||||
using SafeExamBrowser.Contracts.Logging;
|
|
||||||
|
|
||||||
namespace SafeExamBrowser.Client.UnitTests.Operations
|
|
||||||
{
|
|
||||||
[TestClass]
|
|
||||||
public class InitializationOperationTests
|
|
||||||
{
|
|
||||||
private Mock<ILogger> logger;
|
|
||||||
private InitializationOperation sut;
|
|
||||||
|
|
||||||
[TestInitialize]
|
|
||||||
public void Initialize()
|
|
||||||
{
|
|
||||||
logger = new Mock<ILogger>();
|
|
||||||
sut = new InitializationOperation(logger.Object);
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void MustPerformSuccessfully()
|
|
||||||
{
|
|
||||||
var result = sut.Perform();
|
|
||||||
|
|
||||||
Assert.AreEqual(OperationResult.Success, result);
|
|
||||||
Assert.IsTrue(ServicePointManager.SecurityProtocol.HasFlag(SecurityProtocolType.Tls));
|
|
||||||
Assert.IsTrue(ServicePointManager.SecurityProtocol.HasFlag(SecurityProtocolType.Tls11));
|
|
||||||
Assert.IsTrue(ServicePointManager.SecurityProtocol.HasFlag(SecurityProtocolType.Tls12));
|
|
||||||
Assert.IsTrue(ServicePointManager.SecurityProtocol.HasFlag(SecurityProtocolType.Ssl3));
|
|
||||||
}
|
|
||||||
|
|
||||||
[TestMethod]
|
|
||||||
public void MustRevertSuccessfully()
|
|
||||||
{
|
|
||||||
var result = sut.Revert();
|
|
||||||
|
|
||||||
Assert.AreEqual(OperationResult.Success, result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -86,7 +86,6 @@
|
||||||
<Compile Include="Operations\ClipboardOperationTests.cs" />
|
<Compile Include="Operations\ClipboardOperationTests.cs" />
|
||||||
<Compile Include="Operations\ConfigurationOperationTests.cs" />
|
<Compile Include="Operations\ConfigurationOperationTests.cs" />
|
||||||
<Compile Include="Operations\DisplayMonitorOperationTests.cs" />
|
<Compile Include="Operations\DisplayMonitorOperationTests.cs" />
|
||||||
<Compile Include="Operations\InitializationOperationTests.cs" />
|
|
||||||
<Compile Include="Operations\KeyboardInterceptorOperationTests.cs" />
|
<Compile Include="Operations\KeyboardInterceptorOperationTests.cs" />
|
||||||
<Compile Include="Operations\MouseInterceptorOperationTests.cs" />
|
<Compile Include="Operations\MouseInterceptorOperationTests.cs" />
|
||||||
<Compile Include="Operations\ProcessMonitorOperationTests.cs" />
|
<Compile Include="Operations\ProcessMonitorOperationTests.cs" />
|
||||||
|
|
|
@ -104,7 +104,6 @@ namespace SafeExamBrowser.Client
|
||||||
|
|
||||||
var operations = new Queue<IOperation>();
|
var operations = new Queue<IOperation>();
|
||||||
|
|
||||||
operations.Enqueue(new InitializationOperation(logger));
|
|
||||||
operations.Enqueue(new I18nOperation(logger, text, textResource));
|
operations.Enqueue(new I18nOperation(logger, text, textResource));
|
||||||
operations.Enqueue(new RuntimeConnectionOperation(logger, runtimeProxy, startupToken));
|
operations.Enqueue(new RuntimeConnectionOperation(logger, runtimeProxy, startupToken));
|
||||||
operations.Enqueue(new ConfigurationOperation(configuration, logger, runtimeProxy));
|
operations.Enqueue(new ConfigurationOperation(configuration, logger, runtimeProxy));
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
|
|
||||||
*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
using System.Net;
|
|
||||||
using SafeExamBrowser.Contracts.Core.OperationModel;
|
|
||||||
using SafeExamBrowser.Contracts.Core.OperationModel.Events;
|
|
||||||
using SafeExamBrowser.Contracts.I18n;
|
|
||||||
using SafeExamBrowser.Contracts.Logging;
|
|
||||||
|
|
||||||
namespace SafeExamBrowser.Client.Operations
|
|
||||||
{
|
|
||||||
internal class InitializationOperation : IOperation
|
|
||||||
{
|
|
||||||
private ILogger logger;
|
|
||||||
|
|
||||||
public event ActionRequiredEventHandler ActionRequired { add { } remove { } }
|
|
||||||
public event StatusChangedEventHandler StatusChanged;
|
|
||||||
|
|
||||||
public InitializationOperation(ILogger logger)
|
|
||||||
{
|
|
||||||
this.logger = logger;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OperationResult Perform()
|
|
||||||
{
|
|
||||||
logger.Info("Initializing client application...");
|
|
||||||
StatusChanged?.Invoke(TextKey.OperationStatus_InitializeClient);
|
|
||||||
|
|
||||||
ConfigureSecurityProtocols();
|
|
||||||
|
|
||||||
return OperationResult.Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OperationResult Revert()
|
|
||||||
{
|
|
||||||
return OperationResult.Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ConfigureSecurityProtocols()
|
|
||||||
{
|
|
||||||
// Enables the security protocols specified below for all web requests which are made during application runtime.
|
|
||||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -74,7 +74,6 @@
|
||||||
<Compile Include="ClientController.cs" />
|
<Compile Include="ClientController.cs" />
|
||||||
<Compile Include="Operations\ClientHostDisconnectionOperation.cs" />
|
<Compile Include="Operations\ClientHostDisconnectionOperation.cs" />
|
||||||
<Compile Include="Operations\ConfigurationOperation.cs" />
|
<Compile Include="Operations\ConfigurationOperation.cs" />
|
||||||
<Compile Include="Operations\InitializationOperation.cs" />
|
|
||||||
<Compile Include="Operations\RuntimeConnectionOperation.cs" />
|
<Compile Include="Operations\RuntimeConnectionOperation.cs" />
|
||||||
<Compile Include="Communication\ClientHost.cs" />
|
<Compile Include="Communication\ClientHost.cs" />
|
||||||
<Compile Include="CompositionRoot.cs" />
|
<Compile Include="CompositionRoot.cs" />
|
||||||
|
|
|
@ -57,7 +57,6 @@ namespace SafeExamBrowser.Contracts.I18n
|
||||||
OperationStatus_EmptyClipboard,
|
OperationStatus_EmptyClipboard,
|
||||||
OperationStatus_FinalizeServiceSession,
|
OperationStatus_FinalizeServiceSession,
|
||||||
OperationStatus_InitializeBrowser,
|
OperationStatus_InitializeBrowser,
|
||||||
OperationStatus_InitializeClient,
|
|
||||||
OperationStatus_InitializeConfiguration,
|
OperationStatus_InitializeConfiguration,
|
||||||
OperationStatus_InitializeKioskMode,
|
OperationStatus_InitializeKioskMode,
|
||||||
OperationStatus_InitializeProcessMonitoring,
|
OperationStatus_InitializeProcessMonitoring,
|
||||||
|
|
|
@ -129,9 +129,6 @@
|
||||||
<Entry key="OperationStatus_InitializeBrowser">
|
<Entry key="OperationStatus_InitializeBrowser">
|
||||||
Initializing browser
|
Initializing browser
|
||||||
</Entry>
|
</Entry>
|
||||||
<Entry key="OperationStatus_InitializeClient">
|
|
||||||
Initializing client application
|
|
||||||
</Entry>
|
|
||||||
<Entry key="OperationStatus_InitializeConfiguration">
|
<Entry key="OperationStatus_InitializeConfiguration">
|
||||||
Initializing application configuration
|
Initializing application configuration
|
||||||
</Entry>
|
</Entry>
|
||||||
|
|
Loading…
Add table
Reference in a new issue