{"record":{"id":"b7f4d406bdf1d13b","repo":"grpc/grpc-java","slug":"tls-not-supported-in-inprocessserver","errorCode":null,"errorMessage":"TLS not supported in InProcessServer","messagePattern":"TLS not supported in InProcessServer","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"inprocess/src/main/java/io/grpc/inprocess/InProcessServerBuilder.java","lineNumber":209,"sourceCode":"   * @return this\n   * @throws IllegalArgumentException if bytes is non-positive\n   * @since 1.17.0\n   */\n  @Override\n  public InProcessServerBuilder maxInboundMetadataSize(int bytes) {\n    Preconditions.checkArgument(bytes > 0, \"maxInboundMetadataSize must be > 0\");\n    this.maxInboundMetadataSize = bytes;\n    return this;\n  }\n\n  InProcessServer buildTransportServers(\n      List<? extends ServerStreamTracer.Factory> streamTracerFactories) {\n    return new InProcessServer(this, streamTracerFactories);\n  }\n\n  @Override\n  public InProcessServerBuilder useTransportSecurity(File certChain, File privateKey) {\n    throw new UnsupportedOperationException(\"TLS not supported in InProcessServer\");\n  }\n\n  void setStatsEnabled(boolean value) {\n    this.serverImplBuilder.setStatsEnabled(value);\n  }\n}\n","sourceCodeStart":191,"sourceCodeEnd":216,"githubUrl":"https://github.com/grpc/grpc-java/blob/64daddc1f3d1975670f769f3e97bde8b2ba32d25/inprocess/src/main/java/io/grpc/inprocess/InProcessServerBuilder.java#L191-L216","documentation":"InProcessServer is an in-JVM gRPC transport with no real network, so transport security (TLS) is meaningless and unsupported. useTransportSecurity() is overridden to immediately throw UnsupportedOperationException instead of silently accepting credentials that would have no effect.","triggerScenarios":"Calling InProcessServerBuilder.useTransportSecurity(File certChain, File privateKey) (or the String variants) when building an in-process server.","commonSituations":"Copy-pasting a builder setup from a Netty/sharded server to an in-process test server; trying to 'secure' an in-process channel; generic server-building code that unconditionally enables TLS.","solutions":["Remove the useTransportSecurity call — in-process traffic never leaves the JVM and needs no TLS","Use InProcessChannelBuilder/InProcessServerBuilder defaults with no credentials","If TLS is required, switch to a real transport such as NettyChannelBuilder/NettyServerBuilder","Gate TLS setup behind a check that the builder is not the in-process one"],"exampleFix":"// before\nInProcessServerBuilder.forName(\"svc\").useTransportSecurity(new File(\"cert.pem\"), new File(\"key.pem\"));\n// after\nInProcessServerBuilder.forName(\"svc\").directExecutor().build();","handlingStrategy":"validation","validationCode":"if (builder instanceof InProcessServerBuilder) { /* skip TLS setup */ }","typeGuard":"boolean supportsTls(Object b) { return !(b instanceof InProcessServerBuilder); }","tryCatchPattern":"try { b.useTransportSecurity(cert, key); } catch (UnsupportedOperationException e) { log.info(\"TLS unsupported for this transport; continuing insecure\"); }","preventionTips":["Never apply transport-level security to in-process servers","Share server config code with a transport-aware abstraction","Treat in-process channels as trusted loopback"],"tags":["grpc","tls","in-process","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"64daddc1f3d1975670f769f3e97bde8b2ba32d25","analyzedAt":"2026-09-08T06:14:57.704Z","contentChangedAt":"2026-09-08T06:14:57.704Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}