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

Expose SSL_write_ex #5546

Closed
webknjaz opened this issue Nov 2, 2020 · 5 comments
Closed

Expose SSL_write_ex #5546

webknjaz opened this issue Nov 2, 2020 · 5 comments

Comments

@webknjaz
Copy link
Contributor

webknjaz commented Nov 2, 2020

Hello, I see that SSL_write is exposed but SSL_write_ex isn't.

I think it's useful to have it for the purposes of solving pyca/pyopenssl#176.
(That is if I'm reading the docs right)

@reaperhulk
Copy link
Member

We can expose this, but it's 1.1.1+ only. cryptography supports 1.1.0 so it'll need to be a conditional binding.

@webknjaz
Copy link
Contributor Author

webknjaz commented Nov 8, 2020

@reaperhulk thanks for the info! Any idea if sendall() can be implemented w/o it? I'm a little bit confused about whether there are any other ways to detect bytes that's actually been sent over the wire...

@reaperhulk
Copy link
Member

@tiran may know the answer to this -- I don't know OpenSSL's TLS APIs well enough.

@webknjaz
Copy link
Contributor Author

webknjaz commented Nov 8, 2020

I think I've found what I was looking for, it should be possible with SSL_MODE_ENABLE_PARTIAL_WRITE set: pyca/pyopenssl#176 (comment).

@tiran
Copy link
Contributor

tiran commented Nov 9, 2020

Python's ssl module uses SSL_write. The function uses negative values to report errors and positive values how many bytes were written successfully. Then it's a matter of slicind and dicing the send buffer and loop until all data was written. Python doesn't use SSL_MODE_ENABLE_PARTIAL_WRITE.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants