I'm able to send a gRPC request using JetBrains IDEA's HTTP Client (in Rider by the way); To send the request and get the response back.
But when I enable TLS for that gRPC server, I cannot send the request anymore. This is how my .http file looks like now:
###
GRPC grpcs://localhost:5201/identity.IdentityProto/Login
Content-Type: application/json
{
"phone": "09123456789",
"captcha": "haha",
"password": "10"
}
And this is the error I get:
GRPC grpcs://localhost:5201/identity.IdentityProto/Login
com.intellij.grpc.requests.RejectedRPCException: Unknown error occurred during request execution: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
At first, I guessed that this was because I was not setting any valid certificate for the server, so I created a self-signed PFX and configured my server to use that to encrypt requests and made Windows trust it. Finally, the browser was able to validate it:
Sending a sample normal HTTP request to the gRPC server
But doing this didn't fix the problem. I thought now that the machine trusted this certificate, the error might be gone, but it didn't work.
Then another thing that I found out was that I could manually add the certificate to Java's trust store, according to what I understood from this page; It seemed to work, but the problem was I wasn't able to find the exact JVM that my IDE, Rider uses to run.
And still, the problem exists and the error is there. It works fine in Postman with the lock icon set to on and disabling certificate validation, but I couldn't find a particular way to do such a thing for this context.
Is there any solution or workaround to solve this problem without disabling TLS?
Update: I found the /jbr folder and made Java trust the key too, but still the problem exists. The interesting point is that a normal HTTPS request to that server goes well with the Addon, but valid grpcs calls still fail.