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

Allow providing factory functions for SSLContext creation for server and client sockets? #84

Open
ztane opened this issue Jan 15, 2024 · 2 comments

Comments

@ztane
Copy link

ztane commented Jan 15, 2024

We've got a need to heavily customize the SSLContext creation and parameters; however the current code does leave much to be desired. Could it be possible to allow setting a function that takes the config object and returns a SSLContext for both server and client socket; these could then default to two functions that do call socketutil.get_ssl_context(...) but it would be then easier to override for complex use cases?

@irmen
Copy link
Owner

irmen commented Jan 15, 2024

For now, you could just monkeypatch the current get_ssl_context function in the socketutil module, after importing Pyro5, and substitute it with your own?

You can start by looking at what it does currently https://github.com/irmen/Pyro5/blob/8db91b617dd08508053e54dea2a781749a00ffc8/Pyro5/socketutil.py#L528C1-L528C10 and write your own

def my_get_ssl_context(....)
 ....

Pyro5.socketutil.get_ssl_context = my_get_ssl_context

@ztane
Copy link
Author

ztane commented Jan 16, 2024

Yes, that was our initial idea. Will go for that.

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

No branches or pull requests

2 participants