Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load system certs: No valid certificate found #563

Closed
buraktabn opened this issue Jun 13, 2022 · 2 comments
Closed

Failed to load system certs: No valid certificate found #563

buraktabn opened this issue Jun 13, 2022 · 2 comments

Comments

@buraktabn
Copy link

I'm using subxt to get signed extrinsics so I can call call submit_extrinsic from native Dart/Flutter. (I'm working on a Substrate Dart library that wip and basically I need subxt for encoding.) I've encountered this issue on Android. Only happens on wss, localhost works fine.

 cargo ndk -t x86_64 -t arm64-v8a
pub async fn create<T: Into<String>>(url: T) -> anyhow::Result<Client<DefaultConfig>> {
    Ok(ClientBuilder::new()
        .set_url(url)
        .build::<DefaultConfig>()
        .await?)
}

pub async fn create_xt(client: &Client<DefaultConfig>) -> anyhow::Result<Vec<u8>> {
    let bob = AccountKeyring::Bob.public();
    // TransactionApi created from codegen
    let api = TransactionApi::<
        _,
        SubstrateExtrinsicParams<DefaultConfig>,
    >::new(&client);
    let transfer_xt = api.transfer(MultiAddress::Address32(bob.0), 12345641)?;
    let signer = subxt::PairSigner::new(AccountKeyring::Alice.pair());
    let signed = transfer_xt
        .create_signed(&signer, Default::default())
        .await?
        .0;
    Ok(signed)
}
Rpc error: Networking or low-level protocol error: Failed to load system certs: No valid certificate found

Test passes and works fine in Linux. Since I'm using FFI debugging is limited from Flutter side.

Error thrown in here.

maybe related to paritytech/jsonrpsee#321

@niklasad1
Copy link
Member

hey @buraktabn

This error is because rustls-native-certs doesn't support android.

You could try configuring the ws-client yourself and change the certification store to webpki but I'm not sure whether it works

@buraktabn
Copy link
Author

Changing the certification store to webpki solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants