Skip to content

Commit 7310e8a

Browse files
committed
SelfProvisioning: fix certificate response parsing
1 parent 9976166 commit 7310e8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/utility/SelfProvisioning/SelfProvisioning.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,8 @@ void ArduinoCertificate(String user_token, String DeviceUuid, String csr) {
463463
}
464464
intIndex++;
465465
}
466-
JSONVar myObject = JSON.parse(certResponse);
466+
char* p = strstr(certResponse, "{");
467+
JSONVar myObject = JSON.parse(p);
467468
String certZip = JSON.stringify(myObject["compressed"]);
468469
JSONVar myCert = JSON.parse(certZip);
469470
if (myCert.hasOwnProperty("not_before") &&

0 commit comments

Comments
 (0)