{"record":{"id":"7b81a9818d6b1dbc","repo":"alibaba/nacos","slug":"server-certchainfile-or-certprivatekey-must-be-not","errorCode":null,"errorMessage":"Server certChainFile or certPrivateKey must be not null","messagePattern":"Server certChainFile or certPrivateKey must be not null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/alibaba/nacos/core/remote/grpc/negotiator/tls/DefaultTlsContextBuilder.java","lineNumber":53,"sourceCode":"import javax.net.ssl.SSLException;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.Arrays;\n\n/**\n * Ssl context builder.\n *\n * @author xiweng.yy\n */\npublic class DefaultTlsContextBuilder {\n    \n    private static final ResourceLoader RESOURCE_LOADER = new DefaultResourceLoader();\n    \n    static SslContext getSslContext(RpcServerTlsConfig rpcServerTlsConfig) {\n        try {\n            if (StringUtils.isBlank(rpcServerTlsConfig.getCertChainFile()) || StringUtils\n                .isBlank(rpcServerTlsConfig.getCertPrivateKey())) {\n                throw new IllegalArgumentException(\n                    \"Server certChainFile or certPrivateKey must be not null\");\n            }\n            InputStream certificateChainFile =\n                getInputStream(rpcServerTlsConfig.getCertChainFile(), \"certChainFile\");\n            InputStream privateKeyFile =\n                getInputStream(rpcServerTlsConfig.getCertPrivateKey(), \"certPrivateKey\");\n            SslContextBuilder sslClientContextBuilder = SslContextBuilder\n                .forServer(certificateChainFile, privateKeyFile,\n                    rpcServerTlsConfig.getCertPrivateKeyPassword());\n            \n            if (StringUtils.isNotBlank(rpcServerTlsConfig.getProtocols())) {\n                sslClientContextBuilder.protocols(rpcServerTlsConfig.getProtocols().split(\",\"));\n            }\n            \n            if (StringUtils.isNotBlank(rpcServerTlsConfig.getCiphers())) {\n                sslClientContextBuilder\n                    .ciphers(Arrays.asList(rpcServerTlsConfig.getCiphers().split(\",\")));\n            }","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/core/src/main/java/com/alibaba/nacos/core/remote/grpc/negotiator/tls/DefaultTlsContextBuilder.java#L35-L71","documentation":"Error \"Server certChainFile or certPrivateKey must be not null\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at core/src/main/java/com/alibaba/nacos/core/remote/grpc/negotiator/tls/DefaultTlsContextBuilder.java:53 when the library encounters an invalid state.","commonSituations":"Starting a TLS gRPC server without certChainFile or certPrivateKey configured.","solutions":["Correct the invalid value for server TLS cert missing to match the expected format or allowed set, then retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}