Skip to content

Commit f24ddc9

Browse files
authored
Merge pull request #220 from Inumedia/tls12
Force TLS1.2 support as requested by Slack
2 parents 54f817d + 5ece0e8 commit f24ddc9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

SlackAPI.Tests/UserUIInteraction.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
namespace SlackAPI.Tests
1212
{
13+
// Run UI tests on a single plateform to avoid Slack Captcha
14+
// (captcha is displayed when trying to login too often)
15+
#if NETFRAMEWORK
1316
[Collection("Integration tests")]
1417
public class UserUIInteraction
1518
{
@@ -70,4 +73,5 @@ private AccessTokenResponse GetAccessToken(SlackClientHelpers slackClientHelpers
7073
return accessTokenResponse;
7174
}
7275
}
76+
#endif
7377
}

SlackAPI/SlackClientBase.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ public abstract class SlackClientBase
1414
private readonly HttpClient httpClient;
1515
public string APIBaseLocation { get; set; } = "https://slack.com/api/";
1616

17+
static SlackClientBase()
18+
{
19+
#if !NETSTANDARD1_3 && !NETSTANDARD1_6
20+
// Force Tls 1.2 for Slack
21+
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
22+
#endif
23+
}
24+
1725
protected SlackClientBase()
1826
{
1927
this.httpClient = new HttpClient();

0 commit comments

Comments
 (0)