Skip to content

Commit

Permalink
Create macOS release builds with bundled root certificates
Browse files Browse the repository at this point in the history
As reported in #244, some users
on macOS had problems with `rustls-tls-native-roots`. Since we did not
find the root cause of this, we'll build macOS release builds with
`rustls-tls-webpki-roots` instead.

I first tried to solve this issue with default features and conditional
dependencies in `Cargo.toml`, but ultimately gave up and resorted to
`sed`.
  • Loading branch information
dbrgn committed May 3, 2022
1 parent d138ce2 commit 1403f42
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ jobs:
with:
command: test
args: --all-features
# macOS-only steps
- name: Patch to use webpki roots (macOS only)
if: matrix.platform == 'macos-latest'
run: sed -i '' 's/rustls-tls-native-roots/rustls-tls-webpki-roots/' Cargo.toml
- name: Build with webpki roots (macOS only)
if: matrix.platform == 'macos-latest'
uses: actions-rs/cargo@v1
with:
command: build

clippy:
name: run clippy lints
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ jobs:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Patch to use webpki roots
run: sed -i '' 's/rustls-tls-native-roots/rustls-tls-webpki-roots/' Cargo.toml
- name: Build
uses: actions-rs/cargo@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ atty = "0.2"
clap = { version = "3", features = ["std", "derive", "suggestions", "color"], default-features = false }
env_logger = { version = "0.9", optional = true }
log = "0.4"
reqwest = { version = "0.11.3", features = ["blocking", "rustls-tls", "rustls-tls-native-roots"], default-features = false }
reqwest = { version = "0.11.3", features = ["blocking", "rustls-tls-native-roots"], default-features = false }
serde = "1.0.21"
serde_derive = "1.0.21"
toml = "0.5.1"
Expand Down

0 comments on commit 1403f42

Please sign in to comment.