schollz/croc · error · Error

Peer uses unsupported PAKE protocol version ${version ?? 0};

Error message

Peer uses unsupported PAKE protocol version ${version ?? 0}; upgrade both croc clients

What it means

During a PAKE handshake the peer advertised a protocol version other than PAKE_PROTOCOL_VERSION (currently 2), or omitted it (reported as 0). The client refuses to continue because the derived keys and message framing would not be compatible. This is an intentional hard incompatibility check between croc client versions.

Source

Thrown at web/src/protocol/client.ts:56

const PAKE_PURPOSE_LOCAL_PROBE = "local-ip-probe";

type RelayConnection = {
  socket: CrocSocket;
  banner: string;
  externalIP: string;
};

function abortError() {
  return new DOMException("Transfer cancelled", "AbortError");
}

function checkAbort(signal?: AbortSignal) {
  if (signal?.aborted) throw abortError();
}

function requirePakeVersion(version: number | undefined) {
  if (version !== PAKE_PROTOCOL_VERSION) {
    throw new Error(
      `Peer uses unsupported PAKE protocol version ${version ?? 0}; upgrade both croc clients`,
    );
  }
}

function validateSecret(secret: string) {
  if (secret.length < 6) throw new Error("Code must be at least 6 characters");
  if (!/^[\x20-\x7e]+$/.test(secret)) {
    throw new Error("Custom codes must use printable ASCII characters");
  }
}

function controlPort(relayAddress: string) {
  try {
    const parsed = new URL(
      relayAddress.includes("://") ? relayAddress : `tcp://${relayAddress}`,
    );
    return parsed.port || CONTROL_PORT;

View on GitHub (pinned to e25f1bdc04)

Solutions

  1. Upgrade the croc client on BOTH ends so both negotiate version 2
  2. If you control both builds, align PAKE_PROTOCOL_VERSION in client.ts with the Go implementation and rebuild
  3. Verify the web bundle's croc.wasm matches the released croc version you are pairing with

Example fix

// before: mixed versions
// sender: croc v9.6.6 (PAKE v1)  ->  recipient: this web client (PAKE v2)
// Error: Peer uses unsupported PAKE protocol version 1

// after
$ croc upgrade   # or reinstall both ends at the same release
# retry the transfer with matching clients
Defensive patterns

Strategy: try-catch

Validate before calling

// Before connecting, verify the local PAKE version is the one you ship
import { PAKE_VERSION } from "../protocol/version";
if (PAKE_VERSION !== 2) throw new Error("This build speaks an unsupported PAKE version");

Type guard

function isPakeV2(msg) {
  return msg && typeof msg === "object" && msg.v === 2;
}

Try / catch

try {
  await sendFiles(opts);
} catch (e) {
  if (/unsupported PAKE protocol version/.test(e.message)) {
    showBanner("The other side runs a different croc version. Upgrade both and retry.");
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: requirePakeVersion runs on the peer's first control message (probe.Kind === 'pake1' with a Version field) and on 'pake'/'pake-confirm' messages; a peer running croc v9 (v1 PAKE) or a newer v3 protocol triggers it. Mixed CLI and web client versions on the two ends are the usual source.

Common situations: One side has an outdated croc installation; a fork or custom build that changed the version constant; the web wasm bundle built from a different commit than the peer's client.

Related errors


AI-assisted analysis of schollz/croc@e25f1bdc04 (2026-08-15). Data as JSON: /api/errors/25a84c59e5952af8. Report an issue: GitHub.