Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Problem: Missing secure gRPC channel #24

Merged
merged 1 commit into from
Jan 10, 2022

Conversation

macong-cdc
Copy link
Collaborator

Fix unable to use secure gRPC channel to interact with chain

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jan 5, 2022

This pull request introduces 1 alert when merging e4c4b17 into 30b1da0 - view on LGTM.com

new alerts:

  • 1 for Use of insecure SSL/TLS version

Comment on lines +57 to +60
if credentials is None:
channel = insecure_channel(grpc_endpoint)
else:
channel = secure_channel(grpc_endpoint, credentials)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may be better:
channel = insecure_channel(grpc_endpoint, credentials) if credentials else insecure_channel(grpc_endpoint)

or

if credentials:
     channel = secure_channel(grpc_endpoint, credentials)
else:
    channel = insecure_channel(grpc_endpoint)

or using if not credentials:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to explicitly check for None to avoid confusion with False.
In this case, it does not matter that much though, as the variable is not a Boolean type.

@linfeng-crypto linfeng-crypto merged commit 86f4e1f into crypto-org-chain:master Jan 10, 2022
@macong-cdc macong-cdc deleted the secure-grpc branch January 14, 2022 03:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants