{"record":{"id":"82a3c8edd5caa706","repo":"quarkusio/quarkus","slug":"could-not-find-hostname-verifier-class-verifier","errorCode":null,"errorMessage":"Could not find hostname verifier class ${verifier}","messagePattern":"Could not find hostname verifier class (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/RestClientBase.java","lineNumber":159,"sourceCode":"            registerHostnameVerifier(hostnameVerifier.get(), builder);\n        } else {\n            // If `verify-host` is disabled, we configure the client using the `NoopHostnameVerifier` verifier.\n            Optional<Boolean> verifyHost = oneOf(restClientConfig.verifyHost(), configRoot.verifyHost());\n            if (verifyHost.isPresent() && !verifyHost.get()) {\n                registerHostnameVerifier(NoopHostnameVerifier.class.getName(), builder);\n            }\n        }\n    }\n\n    private void registerHostnameVerifier(String verifier, RestClientBuilder builder) {\n        try {\n            Class<?> verifierClass = Thread.currentThread().getContextClassLoader().loadClass(verifier);\n            builder.hostnameVerifier((HostnameVerifier) verifierClass.getDeclaredConstructor().newInstance());\n        } catch (NoSuchMethodException e) {\n            throw new RuntimeException(\n                    \"Could not find a public, no-argument constructor for the hostname verifier class \" + verifier, e);\n        } catch (ClassNotFoundException e) {\n            throw new RuntimeException(\"Could not find hostname verifier class \" + verifier, e);\n        } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {\n            throw new RuntimeException(\n                    \"Failed to instantiate hostname verifier class \" + verifier\n                            + \". Make sure it has a public, no-argument constructor\",\n                    e);\n        } catch (ClassCastException e) {\n            throw new RuntimeException(\"The provided hostname verifier \" + verifier + \" is not an instance of HostnameVerifier\",\n                    e);\n        }\n    }\n\n    private void registerKeyStore(String keyStorePath, RestClientBuilder builder) {\n        try {\n            Optional<String> keyStoreType = oneOf(restClientConfig.keyStoreType(), configRoot.keyStoreType());\n            KeyStore keyStore = KeyStore.getInstance(keyStoreType.orElse(\"JKS\"));\n\n            Optional<String> keyStorePassword = oneOf(restClientConfig.keyStorePassword(), configRoot.keyStorePassword());\n            if (keyStorePassword.isEmpty()) {","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/RestClientBase.java#L141-L177","documentation":"The hostname verifier class name configured for a REST client could not be loaded through the thread context class loader (ClassNotFoundException). The value must be a fully qualified class name visible to the application at runtime. This typically means the class name is wrong or the class is not on the classpath/native image.","triggerScenarios":"Setting quarkus.rest-client.<name>.hostname-verifier (or matching MicroProfile config) to a misspelled or non-existent fully-qualified class name, or a class in a module/jar not included in the application.","commonSituations":"Typos or wrong package in the configured class name; class lives in a library not declared as a dependency; native-image build excluded the class (no reflection/registration needed for load, but the class itself must be reachable); renaming/refactoring the class without updating config.","solutions":["Verify the configured value is the exact fully-qualified class name (package included, correct case)","Add the module/jar containing the class to the application dependencies","Check that the class wasn't renamed or moved; update the config accordingly"],"exampleFix":"# before\nquarkus.rest-client.my-client.hostname-verifier=com.acme.MyHostVerifier\n# after\nquarkus.rest-client.my-client.hostname-verifier=com.acme.security.MyHostnameVerifier","handlingStrategy":"validation","validationCode":"try {\n    Class.forName(verifierName, false, Thread.currentThread().getContextClassLoader());\n} catch (ClassNotFoundException e) {\n    throw new IllegalStateException(\"Hostname verifier class not on classpath: \" + verifierName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    // build the rest client / start the app\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof ClassNotFoundException) {\n        log.error(\"Check hostname-verifier config value and app dependencies\");\n    }\n}","preventionTips":["Always use fully-qualified class names in hostname-verifier config","Add the artifact containing the verifier as an application dependency","Update config when refactoring class names/packages","Verify class visibility under Quarkus' split classloading"],"tags":["restclient","ssl","classpath"],"backgroundTag":"classnotfound","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"}