Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-https-check

Minimal Rust HTTPS client to reproduce the common missing CA certificates problem in scratch-based Docker images.

This project contains:

  • broken.Dockerfile → Multi-stage build without CA certificates (HTTPS requests fail).
  • Dockerfile → Multi-stage build with CA certificates (HTTPS requests succeed).
  • Makefile → Helper commands to build and run both versions quickly.

How it works

  • The Rust application uses reqwest with rustls-tls-native-roots, which relies on the system's certificate store.
  • In a scratch image, /etc/ssl/certs is missing by default, causing HTTPS requests to fail.
  • Adding the ca-certificates file fixes the problem.

Requirements

Quick usage with Makefile

Broken build (no CA certificates)

make build-broken
make run-broken

Expected output: A certificate verification error due to missing root CAs.

Fixed build (with CA certificates)

make build
make run

Expected output: Status: 200 OK with the number of bytes from the response body.

About

Minimal Rust HTTPS client to reproduce missing CA certificates issue in Docker scratch images

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages