Skip to content

Commit 8275075

Browse files
committed
fix SHA1 fingerprint verification
1 parent 91bf8f8 commit 8275075

3 files changed

Lines changed: 5 additions & 25 deletions

File tree

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
},
1010
"frameworks": "arduino",
1111
"platforms": [ "espressif8266", "espressif32", "atmelsam" ],
12-
"version": "0.3.1"
12+
"version": "0.3.2"
1313
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=HARestAPI
2-
version=0.3.1
2+
version=0.3.2
33
author=debsahu
44
maintainer=debsahu
55
sentence=Home Assistant Rest API

src/HARestAPI.cpp

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,7 @@ String HARestAPI::sendGetHA(String URL)
9999
}
100100
if ( _fingerprint.length() > 0)
101101
{
102-
if (wsclient->verify(_fingerprint.c_str(), _serverip.c_str()))
103-
{
104-
if (_debug)
105-
Serial.println("Certificate matches");
106-
}
107-
else
108-
{
109-
if (_debug)
110-
Serial.println("Certificate doesn't match");
111-
_skip_sendurl = true;
112-
}
102+
wsclient->setFingerprint(_fingerprint.c_str())
113103
}
114104
if (!_skip_sendurl)
115105
{
@@ -196,19 +186,9 @@ bool HARestAPI::sendPostHA(String URL, String message)
196186
Serial.print("Connecting: ");
197187
Serial.println(posturl);
198188
}
199-
if ( _fingerprint.length() > 0)
189+
if ( _fingerprint.length() > 0 )
200190
{
201-
if (wsclient->verify(_fingerprint.c_str(), _serverip.c_str()))
202-
{
203-
if (_debug)
204-
Serial.println("Certificate matches");
205-
}
206-
else
207-
{
208-
if (_debug)
209-
Serial.println("Certificate doesn't match");
210-
_skip_sendurl = true;
211-
}
191+
wsclient-> setFingerprint(_fingerprint.c_str())
212192
}
213193
if (!_skip_sendurl)
214194
{

0 commit comments

Comments
 (0)