Skip to content

Bundle root certificates at compile time#39

Merged
tpoliaw merged 1 commit into
mainfrom
root_certs
Jan 13, 2025
Merged

Bundle root certificates at compile time#39
tpoliaw merged 1 commit into
mainfrom
root_certs

Conversation

@tpoliaw

@tpoliaw tpoliaw commented Jan 13, 2025

Copy link
Copy Markdown
Collaborator

In order to make https connections for authorisation, the reqwuest
library needs root certificates. In the minimal container used, these
are not present in the OS so authorisation fails. By bundling them at
compile time (via the webpki-roots crate) the native certificates are
not required.

This usually presents a maintenance burden as the application needs to
be recompiled if root CA certificates change, however in the case where
the application is running in a container, the container would need to
be rebuilt in either case to include the new certificates.

In order to make https connections for authorisation, the reqwuest
library needs root certificates. In the minimal container used, these
are not present in the OS so authorisation fails. By bundling them at
compile time (via the webpki-roots crate) the native certificates are
not required.

This usually presents a maintenance burden as the application needs to
be recompiled if root CA certificates change, however in the case where
the application is running in a container, the container would need to
be rebuilt in either case to include the new certificates.
@garryod

garryod commented Jan 13, 2025

Copy link
Copy Markdown

Seems reasonable to me - it's what I do for most of my services. My only suggestion would be setting up dependabot to automate the updates though this is a bit tricky if the upgraded dependency is only in the Cargo.lock

@tpoliaw

tpoliaw commented Jan 13, 2025

Copy link
Copy Markdown
Collaborator Author

Thanks, I'll look into setting up dependabot in a separate change.

this is a bit tricky if the upgraded dependency is only in the Cargo.lock

Tricky but doable/copyable?

@garryod

garryod commented Jan 13, 2025

Copy link
Copy Markdown

Thanks, I'll look into setting up dependabot in a separate change.

this is a bit tricky if the upgraded dependency is only in the Cargo.lock

Tricky but doable/copyable?

Looks like you can set the dependabot dependency-type to indirect. Might be noisy though

@tpoliaw tpoliaw merged commit c6f4514 into main Jan 13, 2025
@tpoliaw tpoliaw deleted the root_certs branch January 13, 2025 16:17
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