MinBZK / nl-wallet

NL Public Reference Wallet
https://edi.pleio.nl
Other
138 stars 17 forks source link

Panic occurred: Could not build reqwest HTTP client: reqwest::Error { kind: Builder, source: InvalidCertificate(BadEncoding) } #12

Closed phavekes closed 1 week ago

phavekes commented 4 weeks ago

I've build the Android version of the app, and installed in onto a device. When starting the app, it crashes on establishing a SSL connection. ADB logcat shows :

08-14 13:31:47.817  1444  1444 D SurfaceFlinger: Find Focus windowName=73de09e nl.rijksoverheid.edi.wallet/nl.rijksoverheid.edi.wallet.MainActivity, notVisible=1
08-14 13:31:47.818  1444  1444 D Layer   : Focus: nl.rijksoverheid.edi.wallet/nl.rijksoverheid.edi.wallet.MainActivity#252205 isHiddenByPolicy s.flags&layer_state_t::eLayerHidden=1
08-14 13:31:47.819  1444  1892 D SurfaceFlinger: updateWinowInfo=1, setFocusedWindow timestamp=1607613518636051, windowName=73de09e nl.rijksoverheid.edi.wallet/nl.rijksoverheid.edi.wallet.MainActivity
08-14 13:31:48.528  2102  2132 I heid.edi.wallet: Compiler allocated 4774KB to compile void android.view.ViewRootImpl.performTraversals()
08-14 13:31:49.957  2102  2183 E core    : 2024-08-14T11:31:49.957011Z ERROR wallet_core::logging::panic: Panic occurred: Could not build reqwest HTTP client: reqwest::Error { kind: Builder, source: InvalidCertificate(BadEncoding) }
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958171Z ERROR wallet_core::logging::panic:    0: wallet_core::logging::panic::init_panic_logger::{{closure}}
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958222Z ERROR wallet_core::logging::panic:              at /src/wallet_core/flutter_api/src/logging/panic.rs:14:25
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958251Z ERROR wallet_core::logging::panic:    1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958272Z ERROR wallet_core::logging::panic:              at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/alloc/src/boxed.rs:2077:9
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958294Z ERROR wallet_core::logging::panic:       std::panicking::rust_panic_with_hook
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958315Z ERROR wallet_core::logging::panic:              at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:799:13
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958336Z ERROR wallet_core::logging::panic:    2: std::panicking::begin_panic_handler::{{closure}}
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958357Z ERROR wallet_core::logging::panic:              at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:664:13
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958377Z ERROR wallet_core::logging::panic:    3: std::sys_common::backtrace::__rust_end_short_backtrace
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958398Z ERROR wallet_core::logging::panic:              at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/sys_common/backtrace.rs:171:18
08-14 13:31:49.958  2102  2183 E core    : 2024-08-14T11:31:49.958419Z ERROR wallet_core::logging::panic:    4: rust_begin_unwind

Could it be a client-certificate needs to be added, or is a remote endpoint unavailable?

confiks commented 4 weeks ago

What steps did you take to build the application? Through ./scripts/setup-devenv.sh and ./scripts/start-devenv.sh?

phavekes commented 4 weeks ago

I've built the app using the commandline tools bundle exec fastlane android build

confiks commented 4 weeks ago

It's recommended to use the two scripts I mentioned above to setup a development environment, and the other prerequisites mentioned in the readme. Those will setup all the necessary configuration and supporting applications, including generating the necessary certificates that are used for relying party authentication. If you have the prerequisites, it should launch the app inside the simulator or a connected phone without any other steps.

Running Fastlane manually and/or creating release builds outside of CI is not recommended/supported, but you can find the options used in CI here. That job depends on the wallet-env-config task.

For a one-off release build it's probably easier to modify the invocation of flutter run at the end of start-devenv.sh to flutter build apk --release. You still need to add an APK signing certificate to the signingConfigs in wallet_app/android/app/build.gradle.

phavekes commented 4 weeks ago

Thank you for your suggestions. I do not want to install the complete dev-enviroment and all the software coming with it. I want to test the reference wallet app against our own issuers and verifiers. Instructions to build the app without all other services would be very helpful. Or could a APK be included in releases?

phavekes commented 1 week ago

Building using the full environment / all components works fine. Some instructions to use this outside localhost would be nice.