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

aws_sdk_s3::Client with custom ca_cert example #334

Closed
2 tasks done
oxlade39 opened this issue Dec 9, 2021 · 4 comments
Closed
2 tasks done

aws_sdk_s3::Client with custom ca_cert example #334

oxlade39 opened this issue Dec 9, 2021 · 4 comments
Labels
guidance Question that needs advice or information.

Comments

@oxlade39
Copy link

oxlade39 commented Dec 9, 2021

Prerequisites

Question Description

I'm trying to find an example of creating an aws_sdk_s3::Client with a custom cert.
I seem to be going around in circles trying the various TLS options with the various client/connector options.

with the following code:

extern crate dotenv;

use aws_sdk_s3::{Client, Error};
use aws_config::meta::region::RegionProviderChain;

use dotenv::dotenv;

#[tokio::main]
async fn main() -> Result<(), Error> {
    dotenv().ok();
    env_logger::init();
    let region_provider = RegionProviderChain::default_provider().or_else("us-east-1");
    let config = aws_config::from_env().region(region_provider).load().await;
    let client = Client::new(&config);

    let b = client.list_buckets().send().await?;

    println!("b: {:?}", b);

    Ok(())
}

I'm currently getting a Connection reset by peer error. I'm fairly certain this is because of my corporate network setup and the need to a custom cert chain. I've explored various option in order to use a custom crt file.
I've tried various combinations of rusttls and native-tls and composing hyper and hyper-tls as well as smithy but I can't work out the correct combination, let alone when or why I would choose one combination over another.

Any help appreciated.

Platform/OS/Device

Linux vdiopcuk00065 4.15.0-163-generic #171-Ubuntu SMP Fri Nov 5 11:55:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Language Version

rustc 1.57.0

@oxlade39 oxlade39 added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Dec 9, 2021
@rcoh
Copy link
Contributor

rcoh commented Dec 13, 2021

Hello! In the process of trying to work up an example for you, I realized there are a couple of issues making this quite challenging. I filed #338 to track.

@rcoh
Copy link
Contributor

rcoh commented Dec 20, 2021

The next release will include a way to (relatively) easily provide your own connector for AWS config and generated clients. This isn't super ergonomic at the moment and we'll keep iterating on it

@Velfi Velfi removed the needs-triage This issue or PR still needs to be triaged. label Jan 18, 2022
@Velfi
Copy link
Contributor

Velfi commented Jan 31, 2022

We now have a ca-cert example

@Velfi Velfi closed this as completed Jan 31, 2022
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

3 participants