Skip to content

Commit 0a12cfc

Browse files
author
aliostad
committed
fixing issue #284
1 parent 8aef013 commit 0a12cfc

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

test/CacheCow.Client.Tests/CachingHandlerTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,10 @@ public async Task Issue238_It_cache_even_if_compression_is_on()
557557
InnerHandler = compressionHandler, DefaultVaryHeaders = new[] {"Accept", "Accept-Encoding"}
558558
};
559559

560+
#if NET452
561+
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
562+
#endif
563+
560564
var client = new HttpClient(pipeline);
561565
var request1 = new HttpRequestMessage(HttpMethod.Get, CacheablePublicResource);
562566
var request2 = new HttpRequestMessage(HttpMethod.Get, CacheablePublicResource);

test/CacheCow.Client.Tests/IntegrationTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Xunit;
66
using System;
77
using System.IO;
8+
using System.Net;
89

910
namespace CacheCow.Client.Tests
1011
{
@@ -32,6 +33,10 @@ public async Task Test_GoogleImage_WorksOnFirstSecondRequestNotThird()
3233
[Fact]
3334
public async Task Simple_Caching_Example_From_Issue263()
3435
{
36+
#if NET452
37+
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
38+
#endif
39+
3540
var client = ClientExtensions.CreateClient();
3641
const string CacheableResource = "https://code.jquery.com/jquery-3.3.1.slim.min.js";
3742
var response = await client.GetAsync(CacheableResource);
@@ -44,6 +49,10 @@ public async Task Simple_Caching_Example_From_Issue263()
4449
[Fact] // Skip if the resource becomes unavailable
4550
public async Task Simple_Caching_Example_From_Issue267()
4651
{
52+
#if NET452
53+
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
54+
#endif
55+
4756
var client = ClientExtensions.CreateClient();
4857

4958
// this one does not have a content-type too and that could be somehow related

test/CacheCow.Client.Tests/ResponseSerializationTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Linq;
5+
using System.Net;
56
using System.Net.Http;
67
using System.Text;
78
using CacheCow.Client;
@@ -33,6 +34,10 @@ public async Task IntegrationTest_Deserialize()
3334
[Fact]
3435
public async Task IntegrationTest_Serialize_Deserialize()
3536
{
37+
#if NET452
38+
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
39+
#endif
40+
3641
var httpClient = new HttpClient();
3742
var httpResponseMessage = await httpClient.GetAsync("https://webhooks.truelayer-sandbox.com/.well-known/jwks");
3843
var memoryStream = new MemoryStream();

0 commit comments

Comments
 (0)