0

I am testing a gRPC API, written in the GO language. My tests are written in Python (using grpcio lib).

I need to send gRPC requests over HTTPS (using secure_channel(), as far as I understand), but our server doesn't have any certificates. All tests are runned in LAN. And I need to find a way to send a secure_channel() requests without SSL verification.

Is there any way to disable SSL verification from in Python gRPC? All the solutions, I've found in internet don't work.

I'd really appreciate your help. Thanks a lot!

For example, I tried next code:

channel_credentials = grpc.ssl_channel_credentials()
channel_credentials.ssl_target_name_override = ''
channel = grpc.secure_channel('server_address', channel_credentials)

And I tried this one:

channel_credentials = grpc.ssl_channel_credentials(root_certificates=b'')
channel = grpc.secure_channel('server_address', channel_credentials)

But none of them worked :(

6
  • " our server doesn't have any certificates." - I'm pretty sure it has certificates. Maybe not certificates you trust, but certificates nevertheless. Commented Apr 18, 2024 at 8:16
  • "All the solutions, I've found in internet don't work." - While it is good that you have looked around and tried things, this statement is unfortunately useless here unless you also provide EVERYTHING what you actually tried and how it failed. Otherwise it is likely that you will get only pointed out things you've already tried. Therefore marked as duplicate of similar questions which look different to what you've shown, even if you might have tried these. Also, always provide full error messages and reproducible code, instead of just stating that it does not work. Commented Apr 18, 2024 at 8:21
  • "our server doesn't have any certificates" if your server doesn't have any certificates then how are you even using a secure channel? Commented Apr 18, 2024 at 8:23
  • @SteffenUllrich Thank you for your answer, you're absolutely right! I provided code snippets that I've found in Internet after this statement: "For example, I tried next code:" Commented Apr 18, 2024 at 8:26
  • @AbdulAzizBarkat That is my question: Is there any way to use a secure channel without verifying SSL certificates? For example, in Python lib requests you can set the "verify" param to False and use https Commented Apr 18, 2024 at 8:28

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.