Summary: The CSR has no need to change, don't recreate it every time we need it. Useful for the physical iOS case especially, because it connects to the portforwarder and keeps attempting to send a CSR. Reviewed By: passy Differential Revision: D14131617 fbshipit-source-id: 82a69d5aff813d77fa05dd13fc2441b784766d99
40 lines
915 B
C++
40 lines
915 B
C++
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the LICENSE
|
|
* file in the root directory of this source tree.
|
|
*/
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <folly/io/async/SSLContext.h>
|
|
#include <folly/dynamic.h>
|
|
#include "FlipperInitConfig.h"
|
|
|
|
using namespace folly;
|
|
|
|
namespace facebook {
|
|
namespace flipper {
|
|
|
|
class ConnectionContextStore {
|
|
|
|
public:
|
|
ConnectionContextStore(DeviceData deviceData);
|
|
bool hasRequiredFiles();
|
|
std::string getCertificateSigningRequest();
|
|
std::shared_ptr<SSLContext> getSSLContext();
|
|
std::string getCertificateDirectoryPath();
|
|
std::string getDeviceId();
|
|
void storeConnectionConfig(folly::dynamic& config);
|
|
|
|
private:
|
|
DeviceData deviceData_;
|
|
std::string csr = "";
|
|
|
|
std::string absoluteFilePath(const char* filename);
|
|
bool resetFlipperDir();
|
|
};
|
|
|
|
} // namespace flipper
|
|
} // namespace facebook
|