Skip to content

Commit

Permalink
Ignore Expired Certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
BJReplay committed Apr 17, 2022
1 parent 99facf2 commit 6531905
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
3 changes: 3 additions & 0 deletions PowerwallService/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@
<setting name="PWCloudRefreshToken" serializeAs="String">
<value />
</setting>
<setting name="IgnoreCertificates" serializeAs="String">
<value>False</value>
</setting>
</PowerwallService.My.MySettings>
</applicationSettings>
<runtime>
Expand Down
4 changes: 2 additions & 2 deletions PowerwallService/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("4.8.1.0")>
<Assembly: AssemblyFileVersion("4.8.1.0")>
<Assembly: AssemblyVersion("4.8.2.0")>
<Assembly: AssemblyFileVersion("4.8.2.0")>
9 changes: 9 additions & 0 deletions PowerwallService/My Project/Settings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions PowerwallService/My Project/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -241,5 +241,8 @@
<Setting Name="PWCloudRefreshToken" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="IgnoreCertificates" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
4 changes: 4 additions & 0 deletions PowerwallService/PowerwallService.vb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ Public Class PowerwallService
Protected Overrides Sub OnStart(ByVal args() As String)
EventLog.WriteEntry("Powerwall Service Starting", EventLogEntryType.Information, 100)

If My.Settings.IgnoreCertificates Then
System.Net.ServicePointManager.ServerCertificateValidationCallback = Function(se As Object, cert As System.Security.Cryptography.X509Certificates.X509Certificate, chain As System.Security.Cryptography.X509Certificates.X509Chain, sslerror As System.Net.Security.SslPolicyErrors) True
End If

SixSecondTimer.Interval = 6 * 1000 ' Every Six Seconds
SixSecondTimer.AutoReset = True
AddHandler SixSecondTimer.Elapsed, AddressOf OnSixSecondTimer
Expand Down

0 comments on commit 6531905

Please sign in to comment.