{"record":{"id":"147687c298393eb4","repo":"quarkusio/quarkus","slug":"proxy-type-http-is-required","errorCode":null,"errorMessage":"Proxy type HTTP is required","messagePattern":"Proxy type HTTP is required","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/proxy-registry/runtime/src/main/java/io/quarkus/proxy/ProxyConfiguration.java","lineNumber":50,"sourceCode":"\n    /**\n     * Proxy connection timeout.\n     */\n    Optional<Duration> proxyConnectTimeout();\n\n    /**\n     * Proxy type.\n     */\n    ProxyType type();\n\n    /**\n     * @return this {@link ProxyConfiguration} if {@link #type()} returns {@link ProxyType#HTTP};\n     *         otherwise throws {@link IllegalStateException}\n     * @throws IllegalStateException if {@link #type()} does not return {@link ProxyType#HTTP}\n     */\n    default ProxyConfiguration assertHttpType() {\n        if (type() != ProxyType.HTTP) {\n            throw new IllegalStateException(\"Proxy type HTTP is required\");\n        }\n        return this;\n    }\n}\n","sourceCodeStart":32,"sourceCodeEnd":55,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/proxy-registry/runtime/src/main/java/io/quarkus/proxy/ProxyConfiguration.java#L32-L55","documentation":"ProxyConfiguration.assertHttpType() is a self-check helper that throws IllegalStateException when the configuration's proxy type is not HTTP. It exists so code that only supports HTTP proxies (e.g. java.net.Proxy construction) can fail fast with a clear message.","triggerScenarios":"Calling assertHttpType() on a ProxyConfiguration built with ProxyType.SOCKS (or any non-HTTP type), typically when configuring an HTTP client that only accepts HTTP proxies.","commonSituations":"A quarkus.proxy.* config entry with quarkus.proxy.\"name\".type=socks being fed to code expecting an HTTP proxy; shared proxy configuration reused across clients with different type requirements.","solutions":["Set quarkus.proxy.\"<name>\".type=http (or remove type to use the default) in application.properties","Check type() == ProxyType.HTTP before calling assertHttpType() or constructing an HTTP client proxy","Create a separate proxy configuration for SOCKS usage"],"exampleFix":"// before\nquarkus.proxy.corporate.type=socks\nquarkus.proxy.corporate.host=proxy.example.com\n// after\nquarkus.proxy.corporate.type=http\nquarkus.proxy.corporate.host=proxy.example.com","handlingStrategy":"validation","validationCode":"ProxyConfiguration cfg = ...;\nif (cfg.type() != ProxyType.HTTP) {\n    throw new IllegalArgumentException(\"Expected HTTP proxy but got \" + cfg.type());\n}","typeGuard":"static boolean isHttpProxy(ProxyConfiguration cfg) {\n    return cfg != null && cfg.type() == ProxyType.HTTP;\n}","tryCatchPattern":"try {\n    cfg.assertHttpType();\n} catch (IllegalStateException e) {\n    // fall back to direct connection or a different, HTTP-typed config\n    cfg = fallbackHttpConfig();\n}","preventionTips":["Set type=http explicitly for proxies used with HTTP clients","Check type() before asserting","Keep separate configs for SOCKS vs HTTP usage"],"tags":["proxy","configuration","illegal-state","http"],"backgroundTag":"proxy-type-mismatch","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}