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

TlsConnectorBuilder constructor #266

Closed
lapointexavier opened this issue May 19, 2023 · 2 comments · Fixed by #271
Closed

TlsConnectorBuilder constructor #266

lapointexavier opened this issue May 19, 2023 · 2 comments · Fixed by #271

Comments

@lapointexavier
Copy link

lapointexavier commented May 19, 2023

Hi,

I wanted to use the TLsConnectorBuilder to add a self signed certificate, and it appears that there's no default constructor for that struct. I know this is very minor, but I was wondering if either I didn't look properly, or if there was an opportunity to improve this api.

Currently I think I'd need to fill in all fields:

TlsConnectorBuilder {
  identity: None,
  min_protocol: None,
  ...
}.add_root_certificates(...).build()

And I'd like to write something similar to:

TlsConnectorBuilder::new().add_root_certificates(...).build()

I assume the default (either through TlsConnectorBuilder::new() or impl Default for TlsConnectorBuilder) would need to populate sensible values.

I'd be happy to contribute.

Thank you

@lapointexavier
Copy link
Author

lapointexavier commented May 19, 2023

My apologies, just saw a test where TlsConnector::builder() is used.

@rust1248
Copy link
Contributor

I stumbled upon this today, I think it should be documented on TlsConnectorBuilder (how to get one)

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

Successfully merging a pull request may close this issue.

2 participants