#4561·iroh

Relay client sends Proxy-Authorization in the URL-safe base64 alphabet

Author: fluffyponyCreated Sep 26, 2026Updated Sep 26, 2026

dial_url_proxy encodes the proxy credentials for Proxy-Authorization: Basic with BASE64URL (iroh-relay/src/client/tls.rs:188 on main, same in 1.2.0):

rust
let encoded = BASE64URL.encode(to_encode.as_bytes());
req_builder = req_builder.header("Proxy-Authorization", format!("Basic {encoded}"));

Basic auth (RFC 7617) wants the standard alphabet from RFC 4648 section 4, not the URL-safe one. Most credentials encode the same in both, which is probably why nobody's tripped over it, but anything that produces a + or / doesn't - eg. user:s3cret>> is dXNlcjpzM2NyZXQ+Pg== in the standard alphabet and dXNlcjpzM2NyZXQ-Pg== in the URL-safe one, and the proxy answers 407.

The fix is a one-liner - data_encoding::BASE64 instead of BASE64URL for this header. Happy to send a PR for it if that's easier for you.