Skip to content

Commit

Permalink
Use TLS 1.1 or 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorMcKay committed Oct 12, 2020
1 parent abff5b1 commit dfc9555
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions HSPI_TeslaPowerwall/PowerwallClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -24,6 +25,7 @@ public PowerwallClient(string ipAddress, HSPI hs) {

// Powerwall Gateway uses a self-signed certificate, so let's accept it unconditionally
handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
}

public async Task<SiteInfo> GetSiteInfo() {
Expand Down

0 comments on commit dfc9555

Please sign in to comment.