Skip to content

Commit b558ce5

Browse files
authored
chore(meshtls-rustls): use aws-lc as the default crypto backend (#4043)
The broader ecosystem has mostly moved to `aws-lc-rs` as the primary `rustls` backend, and we should follow suit. This will also simplify the maintenance of the proxy's TLS implementation in the long term. This requires some extra configuration for successful cross-compilation, ideally we can remove this extra configuration once linkerd/dev v48 is available. This doesn't remove `ring` as a crypto backend, that can come in a follow-up at #4029
1 parent 894d350 commit b558ce5

5 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ jobs:
150150
- name: Install MiniGW
151151
if: matrix.os == 'windows'
152152
run: apt-get update && apt-get install mingw-w64 -y
153+
# TODO: these packages will be included in dev v48
154+
- name: Install cross compilation toolchain
155+
if: matrix.arch == 'arm64'
156+
run: apt-get update && apt-get install --no-install-recommends -y \
157+
binutils-aarch64-linux-gnu
153158
- name: Configure git
154159
run: git config --global --add safe.directory "$PWD" # actions/runner#2033
155160
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@ FROM $LINKERD2_IMAGE as linkerd2
1414
FROM --platform=$BUILDPLATFORM $RUST_IMAGE as fetch
1515

1616
ARG PROXY_FEATURES=""
17+
ARG TARGETARCH="amd64"
1718
RUN apt-get update && \
1819
apt-get install -y time && \
1920
if [[ "$PROXY_FEATURES" =~ .*meshtls-boring.* ]] ; then \
2021
apt-get install -y golang ; \
2122
fi && \
23+
case "$TARGETARCH" in \
24+
amd64) true ;; \
25+
arm64) apt-get install --no-install-recommends -y binutils-aarch64-linux-gnu ;; \
26+
esac && \
2227
rm -rf /var/lib/apt/lists/*
2328

2429
ENV CARGO_NET_RETRY=10
@@ -33,7 +38,6 @@ RUN --mount=type=cache,id=cargo,target=/usr/local/cargo/registry \
3338
FROM fetch as build
3439
ENV CARGO_INCREMENTAL=0
3540
ENV RUSTFLAGS="-D warnings -A deprecated --cfg tokio_unstable"
36-
ARG TARGETARCH="amd64"
3741
ARG PROFILE="release"
3842
ARG LINKERD2_PROXY_VERSION=""
3943
ARG LINKERD2_PROXY_VENDOR=""

justfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ features := ""
1818
export LINKERD2_PROXY_VERSION := env_var_or_default("LINKERD2_PROXY_VERSION", "0.0.0-dev" + `git rev-parse --short HEAD`)
1919
export LINKERD2_PROXY_VENDOR := env_var_or_default("LINKERD2_PROXY_VENDOR", `whoami` + "@" + `hostname`)
2020

21+
# TODO: these variables will be included in dev v48
22+
export AWS_LC_SYS_CFLAGS_aarch64_unknown_linux_gnu := env_var_or_default("AWS_LC_SYS_CFLAGS_aarch64_unknown_linux_gnu", "-fuse-ld=/usr/aarch64-linux-gnu/bin/ld")
23+
export AWS_LC_SYS_CFLAGS_aarch64_unknown_linux_musl := env_var_or_default("AWS_LC_SYS_CFLAGS_aarch64_unknown_linux_musl", "-fuse-ld=/usr/aarch64-linux-gnu/bin/ld")
24+
2125
# The version name to use for packages.
2226
package_version := "v" + LINKERD2_PROXY_VERSION
2327

linkerd/meshtls/rustls/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2018"
77
publish = { workspace = true }
88

99
[features]
10-
default = ["ring"]
10+
default = ["aws-lc"]
1111
ring = ["tokio-rustls/ring", "rustls-webpki/ring"]
1212
aws-lc = ["tokio-rustls/aws-lc-rs", "rustls-webpki/aws-lc-rs"]
1313
aws-lc-fips = ["aws-lc", "tokio-rustls/fips"]

linkerd2-proxy/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish = { workspace = true }
88
description = "The main proxy executable"
99

1010
[features]
11-
default = ["meshtls-rustls-ring"]
11+
default = ["meshtls-rustls-aws-lc"]
1212
meshtls-boring = ["linkerd-meshtls/boring"]
1313
meshtls-boring-fips = ["linkerd-meshtls/boring-fips"]
1414
meshtls-rustls-aws-lc = ["linkerd-meshtls/rustls-aws-lc"]

0 commit comments

Comments
 (0)