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

Use 'cert.install' instead of passing in root certificates. #1116

Merged
merged 4 commits into from
Jun 24, 2024

Conversation

floitsch
Copy link
Member

No description provided.

@floitsch floitsch requested a review from kasperl June 20, 2024 10:36
x509.Certificate.parse it
config_.root-certificate-ders.do:
certificate := tls.RootCertificate it
certificate.install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this early when setting up the config instead? There is no hash for this one (I think), so we're going to parse it every single time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to do this earlier, as the Broker is constructed relatively early, but we don't want to spend time installing roots if they won't be needed.
I added a flag that keeps track of whether they are already installed or not.

@@ -108,9 +108,9 @@ download-url url/string --out-path/string --ui/Ui -> none:
ui.info "Downloading $url."

network := net.open
certificate-roots.install-all-trusted-roots
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda want to this a bit earlier. That's typically how we deal with installed certificates.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@@ -28,6 +28,8 @@ class BrokerCliHttp implements BrokerCli:
client_/http.Client? := null

constructor .server-config_ --.id:
// We are on the host. Just install all certificate roots.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do this earlier?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Copy link
Contributor

@kasperl kasperl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

src/service/brokers/http/connection.toit Outdated Show resolved Hide resolved
@floitsch floitsch enabled auto-merge (squash) June 24, 2024 12:54
@floitsch floitsch merged commit 56576ba into main Jun 24, 2024
13 checks passed
@floitsch floitsch deleted the floitsch/certificates.10.install branch June 24, 2024 13:04
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 this pull request may close these issues.

2 participants