From fb840a13318c83d7ef65d5720a03abe9ecc11891 Mon Sep 17 00:00:00 2001 From: devydd <68201914+devydd@users.noreply.github.com> Date: Wed, 4 Nov 2026 23:49:07 +0000 Subject: [PATCH] Fix Silicon Labs tools download (Commander, SLC CLI) silabs.com is behind Akamai bot protection that now returns 403 for plain curl requests. Send the minimal set of browser-navigation headers that is required (Accept-Language, Sec-Fetch-Dest/Mode/Site/User and User-Agent). SimplicityCommander-Linux.zip also moved from /documents/public/ to /documents/login/ (no actual login is required with these headers). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017A2urhCFvYVJRQLQdBcsxK --- src/silabs/tools.mk | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/silabs/tools.mk b/src/silabs/tools.mk index cd19bcc50f..bdbe58f1b3 100644 --- a/src/silabs/tools.mk +++ b/src/silabs/tools.mk @@ -13,9 +13,21 @@ SIMPLICITY_SDK_ARCHIVE := simplicity-sdk-$(SIMPLICITY_SDK_VERSION).zip SIMPLICITY_SDK_URL := $(SIMPLICITY_SDK_REPO)/releases/download/v$(SIMPLICITY_SDK_VERSION)/simplicity-sdk.zip # Silicon Labs download URLs -COMMANDER_URL := https://www.silabs.com/documents/public/software/SimplicityCommander-Linux.zip +COMMANDER_URL := https://www.silabs.com/documents/login/software/SimplicityCommander-Linux.zip SLC_CLI_URL := https://www.silabs.com/documents/public/software/slc_cli_linux.zip +# silabs.com is behind Akamai bot protection, which rejects (403) requests that +# don't look like a browser navigation. Each of the headers below is required; +# User-Agent must be passed with -H (not -A) so it isn't in curl's usual position. +SILABS_USER_AGENT ?= Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/156.0.0.0 Safari/537.36 +SILABS_CURL_HEADERS := \ + -H 'Accept-Language: en-US,en;q=0.9' \ + -H 'Sec-Fetch-Dest: document' \ + -H 'Sec-Fetch-Mode: navigate' \ + -H 'Sec-Fetch-Site: none' \ + -H 'Sec-Fetch-User: ?1' \ + -H 'User-Agent: $(SILABS_USER_AGENT)' + # ZAP tool configuration ZAP_VERSION := 2025.10.23 ZAP_ARCHIVE := zap-linux-x64.zip @@ -102,7 +114,7 @@ $(TOOLS_DIR)/commander: | $(DOWNLOAD_DIR) @echo "Downloading Simplicity Commander..." @if [ ! -f "$(DOWNLOAD_DIR)/SimplicityCommander-Linux.zip" ]; then \ echo "Attempting to download from: $(COMMANDER_URL)"; \ - if ! curl -L "$(COMMANDER_URL)" \ + if ! curl -L $(SILABS_CURL_HEADERS) "$(COMMANDER_URL)" \ -o "$(DOWNLOAD_DIR)/SimplicityCommander-Linux.zip" \ --fail --show-error --connect-timeout 30; then \ echo "Download failed. Please manually download SimplicityCommander-Linux.zip"; \ @@ -146,7 +158,7 @@ $(TOOLS_DIR)/slc-cli: | $(DOWNLOAD_DIR) @echo "Downloading SLC CLI..." @if [ ! -f "$(DOWNLOAD_DIR)/slc_cli_linux.zip" ]; then \ echo "Attempting to download from: $(SLC_CLI_URL)"; \ - if ! curl -L "$(SLC_CLI_URL)" \ + if ! curl -L $(SILABS_CURL_HEADERS) "$(SLC_CLI_URL)" \ -o "$(DOWNLOAD_DIR)/slc_cli_linux.zip" \ --fail --show-error --connect-timeout 30; then \ echo "Download failed. Please manually download slc_cli_linux.zip"; \