diff options
author | aakash-s45 <tech2aks@gmail.com> | 2022-09-15 22:37:39 +0530 |
---|---|---|
committer | aakash-s45 <tech2aks@gmail.com> | 2022-09-15 23:42:08 +0530 |
commit | 8d876c8592153e810ebfe2719b70e31b94e96e5c (patch) | |
tree | 1b9062ab14d811d01d018a7f1c2f361d507efb1e | |
parent | e39f2a69fde316b4e260c151757fb739494fbd56 (diff) |
Patch for an error caused due to missing file
CA.pem is no longer in the asset folder but still in use in the app.
Bug-AGL: SPEC-4543
Change-Id: I2142f493dec035777a1da0b36edc10bb5dcee5a2
Signed-off-by: Aakash Solanki <tech2aks@gmail.com>
-rw-r--r-- | lib/vehicle_signal/vehicle_signal_config.dart | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/vehicle_signal/vehicle_signal_config.dart b/lib/vehicle_signal/vehicle_signal_config.dart index 3f0ff1d..1eca347 100644 --- a/lib/vehicle_signal/vehicle_signal_config.dart +++ b/lib/vehicle_signal/vehicle_signal_config.dart @@ -10,14 +10,12 @@ final sockConnectprovider = FutureProvider.family<WebSocket, HttpClient>( // load certificates and set context and returns http client
Future<HttpClient> initializeClient() async {
- ByteData dataCA = await rootBundle.load('assets/cert/CA.pem');
ByteData dataCert = await rootBundle.load('assets/cert/Client.pem');
ByteData dataKey = await rootBundle.load('assets/cert/Client.key');
SecurityContext ctx = SecurityContext.defaultContext;
ctx.useCertificateChainBytes(dataCert.buffer.asUint8List());
ctx.usePrivateKeyBytes(dataKey.buffer.asUint8List());
- ctx.setTrustedCertificatesBytes(dataCA.buffer.asUint8List());
HttpClient client = HttpClient(context: ctx)
..findProxy = null
..badCertificateCallback = (cert, host, port) {
|