-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
x509.Certificate.parse it | ||
config_.root-certificate-ders.do: | ||
certificate := tls.RootCertificate it | ||
certificate.install |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/cli/utils/utils.toit
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
src/cli/brokers/http/base.toit
Outdated
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do this earlier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this 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.
Co-authored-by: Kasper Lund <[email protected]>
No description provided.