{"record":{"id":"34a4415385803966","repo":"XX-net/XX-Net","slug":"dontfakeca","errorCode":null,"errorMessage":"DontFakeCA","messagePattern":"DontFakeCA","errorType":"exception","errorClass":"DontFakeCA","httpStatus":null,"severity":"warning","filePath":"code/default/smart_router/local/smart_route.py","lineNumber":301,"sourceCode":"    # avoid close by req.__del__\n    req.rfile._close = False\n    req.wfile._close = False\n    req.connection = None\n\n    if not isinstance(sock, SocketWrap):\n        sock = SocketWrap(sock, client_address[0], client_address[1])\n\n    xlog.info(\"host:%s:%d do_unwrap_socks\", host, port)\n\n    remote_ssl_sock.send(left_buf)\n    sw = SocketWrap(remote_ssl_sock, \"x-tunnel\", port, host)\n    sock.recved_times = 3\n    g.pipe_socks.add_socks(sock, sw)\n\n\ndef do_gae(sock, host, port, client_address, left_buf=\"\"):\n    if not g.gae_proxy:\n        raise DontFakeCA()\n\n    sock.setblocking(1)\n    if left_buf:\n        schema = b\"http\"\n    else:\n        leadbyte = sock.recv(1, socket.MSG_PEEK)\n        if leadbyte in (b'\\x80', b'\\x16'):\n            if host != fake_host and not g.config.enable_fake_ca:\n                raise DontFakeCA()\n\n            try:\n                sock._sock = g.gae_proxy.proxy_handler.wrap_ssl(sock._sock, host, port, client_address)\n            except Exception as e:\n                raise SslWrapFail()\n\n            schema = b\"https\"\n        else:\n            schema = b\"http\"","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/smart_router/local/smart_route.py#L283-L319","documentation":"do_gae raises DontFakeCA when the GAE proxy component (g.gae_proxy) is not loaded, meaning the request cannot be served via GAE. The name is historical: the GAE path requires the fake-CA/SSL capability, and without g.gae_proxy none of that machinery exists, so the router must fall back to another strategy.","triggerScenarios":"Routing a request to the GAE strategy via try_loop when g.gae_proxy is None — e.g. GAE proxy module not initialized in this build or disabled in config.","commonSituations":"Running a build/deployment where the GAE proxy module was removed or failed to import, or config disables GAE while routing rules still reference it.","solutions":["Ensure the GAE proxy module is properly installed/initialized so g.gae_proxy is set","Fix whatever import/init failure prevented the GAE proxy from loading (check startup logs)","Update smart_router rules to not route via GAE when it is unavailable","Catch DontFakeCA and fall back to direct/X-Tunnel strategies"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if not getattr(g, 'gae_proxy', None):\n    skip_strategy('gae')  # don't include GAE in rule_list","typeGuard":"def gae_available() -> bool:\n    return getattr(g, 'gae_proxy', None) is not None","tryCatchPattern":"try:\n    do_gae(...)\nexcept DontFakeCA:\n    try_next_strategy(sock, host, port)","preventionTips":["Initialize or verify the GAE proxy module at startup before adding GAE rules","Build rule_list dynamically from which components actually loaded"],"tags":["gae-proxy","smart-router","module-not-loaded"],"backgroundTag":"required-module-not-initialized","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}