-
Notifications
You must be signed in to change notification settings - Fork 3k
[EventHubs] Custom ssl certificate support when using http proxy #16304
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
Comments
action items:
issue opened in the azure-c-shared-utility repo asking for the certificate support: Azure/azure-c-shared-utility#501 issue about the client-side certificate: Azure/azure-c-shared-utility#513 api proposal for the c lib: https://gist.github.com/yunhaoling/753677c4ee8137f50da38402c6646595 |
Hi! I would really like this to happen. |
hey @fulii, I'm sorry to tell you that the currently the underlying C networking implementation for http proxy only supports basic auth (username and password) and we could do nothing until the support is being added into the C library first so that our uamqp library could take advantage of the feature and expose the settings to the upper layer. I'll continue my work on adding support to the C library this month, but I can't guarantee you the timeline. |
uamqp PR: Azure/azure-uamqp-python#232 prototype is available here: https://github.com/yunhaoling/uamqp-tls-proxy-prototype event hub API proposal is here: https://gist.github.com/yunhaoling/720e8bea2cdd06cdf94515c7e31dd266 API shape in requests:https://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification source code: https://github.com/psf/requests/blob/master/requests/api.py#L16-L47 '''
:param verify: (optional) Either a boolean, in which case it controls whether we verify
the server's TLS certificate, or a string, in which case it must be a path
to a CA bundle to use. Defaults to ``True``.
:param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.
sample:
'''python
requests.get('https://kennethreitz.org', verify='/path/to/certfile', cert=('/path/client.cert', '/path/client.key')) API shape in httpx:https://www.python-httpx.org/advanced/#ssl-certificates source code:
sample: # verify/server certificates
import httpx
r = httpx.get("https://example.org", verify="path/to/client.pem")
# or pass a ssl context
import ssl
import httpx
context = ssl.create_default_context()
context.load_verify_locations(cafile="/tmp/client.pem")
# context = httpx.create_ssl_context(verify="/tmp/client.pem")
httpx.get('https://example.org', verify=context)
# or client side
client = httpx.Client(verify=False) # client side certificates
import httpx
r = httpx.get("https://example.org", cert="path/to/client.pem")
# tuple
cert = ("path/to/client.pem", "path/to/client.key")
# cert = ("path/to/client.pem", "path/to/client.key", "password")
httpx.get("https://example.org", cert=cert) |
hey @fulii , apologize for not getting back to you sooner. I have tried to implement the feature in the uamqp library based on my understanding. please let me know if you need help on testing it out, your feedbacks on the API are also welcomed! (if you're working on Windows or macOS, I could manually build wheels for you as well) |
closing the issue as there's no active development plan for it. Please create a new issue if you feel this is the feature you need, and we could discuss. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
EventHub allows connecting to the service via http proxy.
Currently we expose http proxy setting including:
However, there're scenarios:
We would like to provide the ability to set server/client certificate in EventHub Python SDK for authenticating the identity of the proxy server/client when connection to the service via a http proxy.
Scope of work
Success Criteria
Samples
References
Python request ssl cert
Python request client cert
The text was updated successfully, but these errors were encountered: