Skip to content

Commit

Permalink
fix SHA1 fingerprint verification
Browse files Browse the repository at this point in the history
  • Loading branch information
debsahu committed Sep 7, 2023
1 parent 91bf8f8 commit 8275075
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
},
"frameworks": "arduino",
"platforms": [ "espressif8266", "espressif32", "atmelsam" ],
"version": "0.3.1"
"version": "0.3.2"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=HARestAPI
version=0.3.1
version=0.3.2
author=debsahu
maintainer=debsahu
sentence=Home Assistant Rest API
Expand Down
26 changes: 3 additions & 23 deletions src/HARestAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,7 @@ String HARestAPI::sendGetHA(String URL)
}
if ( _fingerprint.length() > 0)
{
if (wsclient->verify(_fingerprint.c_str(), _serverip.c_str()))
{
if (_debug)
Serial.println("Certificate matches");
}
else
{
if (_debug)
Serial.println("Certificate doesn't match");
_skip_sendurl = true;
}
wsclient->setFingerprint(_fingerprint.c_str())
}
if (!_skip_sendurl)
{
Expand Down Expand Up @@ -196,19 +186,9 @@ bool HARestAPI::sendPostHA(String URL, String message)
Serial.print("Connecting: ");
Serial.println(posturl);
}
if ( _fingerprint.length() > 0)
if ( _fingerprint.length() > 0 )
{
if (wsclient->verify(_fingerprint.c_str(), _serverip.c_str()))
{
if (_debug)
Serial.println("Certificate matches");
}
else
{
if (_debug)
Serial.println("Certificate doesn't match");
_skip_sendurl = true;
}
wsclient-> setFingerprint(_fingerprint.c_str())
}
if (!_skip_sendurl)
{
Expand Down

0 comments on commit 8275075

Please sign in to comment.