Skip to content

Commit

Permalink
Change the logic to check the cert exchange is needed or not
Browse files Browse the repository at this point in the history
Summary:
It has been seen [here](https://fb.workplace.com/groups/flippersupport/permalink/1094276434386347/) that the user's app sandbox can be in a state where it might not have the device id information, but other app certificates. This causes the issue of "Timed out waiting for unknown device".

We get the deviceid from flipper into app's sandbox when cert exchange happens. So if we don't have the device id information, we can again redo the cert exchange to get the sandbox in a state where flipper connects. Thus I updated the logic of `hasRequiredFiles` which checks the required files for cert exchange.

Reviewed By: mweststrate

Differential Revision: D27265693

fbshipit-source-id: ccf311f4728837ee9385c95c38f94c9c93380feb
  • Loading branch information
priteshrnandgaonkar authored and facebook-github-bot committed Mar 24, 2021
1 parent d2fc100 commit 62863c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xplat/Flipper/ConnectionContextStore.cpp
Expand Up @@ -37,8 +37,10 @@ bool ConnectionContextStore::hasRequiredFiles() {
loadStringFromFile(absoluteFilePath(CLIENT_CERT_FILE_NAME));
std::string privateKey =
loadStringFromFile(absoluteFilePath(PRIVATE_KEY_FILE));
std::string config =
loadStringFromFile(absoluteFilePath(CONNECTION_CONFIG_FILE));

if (caCert == "" || clientCert == "" || privateKey == "") {
if (caCert == "" || clientCert == "" || privateKey == "" || config == "") {
return false;
}
return true;
Expand Down

0 comments on commit 62863c8

Please sign in to comment.