Skip to content

Commit 044eca7

Browse files
committed
Force TLS1.2 support as requested by Slack
1 parent 54f817d commit 044eca7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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)