Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy support #133

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Add proxy support #133

merged 1 commit into from
Oct 15, 2023

Conversation

XioNoX
Copy link
Contributor

@XioNoX XioNoX commented Aug 8, 2023

For troubleshooting purposes we need to run our automation (and thus pygnmi) from our laptop instead of prod servers.

GRPC supports the "grpc_proxy" env-var out of the box, but pygnmi does additional certificate verification.
Unfortunately ssl.get_server_certificate doesn't support proxies, so we have to handle it at lower level (the code is greatly inspired by https://stackoverflow.com/questions/53587700).

You can then use it with for example:
grpc_proxy=http://proxy:8080 python3 test-gnmi3.py

For troubleshooting purposes we need to run our automation (and thus
pygnmi) from our laptop instead of prod servers.

GRPC supports the "grpc_proxy" env-var out of the box, but pygnmi does
additional certificate verification.
Unfortunately ssl.get_server_certificate doesn't support proxies, so we
have to handle it at lower level (the code is greatly inspired by
https://stackoverflow.com/questions/53587700).

You can then use it with for example:
`grpc_proxy=http://proxy:8080 python3 test-gnmi3.py`
@akarneliuk akarneliuk merged commit 633a783 into akarneliuk:master Oct 15, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants