How to call a .NET Core 3.0 gRPC Server application with bloomRPC?
Asked Answered
N

2

6

For this question, it is relevant to know that I do have ASP .NET Core experience, do have REST experience but I am a newbee when it comes to gRPC. In addition, I am working on Windows right now.

At first, I created a server project and a client project as explained here.

This works fine and exactly as expected and documented.

Logically, I want to be able to call my server project from a tool (as many developer use a tool -such as Postman- to test their REST Api Server project). I am failing when it comes to this so maybe someone can explain what am I doing wrong and how to resolve my problem? I am using bloomRPC and I get an error I do not understand (my server application is available).

enter image description here

Nickeliferous answered 30/7, 2019 at 17:58 Comment(0)
R
11

Follow steps below:

  1. Make sure RpcServer is running.

  2. Check your launchSettings.json

    {
        "profiles": {
            "GrpcGreeter": {
                "commandName": "Project",
                "launchBrowser": false,
                "applicationUrl": "https://localhost:5001;http://localhost:5000",
                "environmentVariables": {
                    "ASPNETCORE_ENVIRONMENT": "Development"
                }
            }
        }
    }
    
  3. Import proto to bloomRPC

  4. Change Server Address to 0.0.0.0:5000

Regularize answered 31/7, 2019 at 3:30 Comment(4)
The change made to launchsettings.json did the job. Logically, I also stopped using TLS in bloomRPC.. The last step was not fully needed (localhost and 0.0.0.0 both work fine).Nickeliferous
Where is this launchsettings.json file located ?Polypetalous
Thanks @Edward, It's perfect working with 0.0.0.0:5000. But you have idea why it is not working with 0.0.0.0:5001. 0.0.0.0:5000 is working with HTTP & 0.0.0.0:5001 is working with HTTPS.Untuck
This is obviously non-optimal because it isn't using https. It would be very nice to get this working properly with https.Shush
L
1

You can manually import your VisualStudio's certificate into the bloomRPC. Click on the TLS button next to the lock icon. You'll get a popup window where you can add your certificate by clicking on "Add Root Certificate". Use the base-64 encoded X.509 certificate.

ssl target host should be the hostname for which the ssl certificate is generated for, in your case it's localhost.

VisualStudio can create multiple certificates so you need to test which one of them is working for you.

Here are the steps how to export your VisualStudio's certificate from the MMC: https://support.globalsign.com/ssl/ssl-certificates-installation/import-and-export-certificate-microsoft-windows

Importing certificate to BloomRPC

Limber answered 26/3, 2021 at 16:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.