-
Notifications
You must be signed in to change notification settings - Fork 878
[h2o-ssl] Renegotiation Support #597
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
base: master
Are you sure you want to change the base?
Conversation
To support renegotiation, it is sufficient to flush write buffer when write operation is happened in SSL_read().
|
Greetings, Submitted patch is tested by hands: Patched version does renegotiation properly Best regards, |
|
Interesting! However, to make it always work, you must check if there is any write in flight before calling Can you look into resolving the issue? Also, it would be great if you could provide how you are going to use the renegotiation. H2O does not provide an interface to obtain the client certificate (or an interface to initiate renegotiation). Are you using libh2o as an event loop? |
Added spare output buffer, waitbuf, to queue output payloads while another write operation is in flight. At now, waitbuf is only used for coping to renegotiation case. There can be, however, other use for waitbuf since waitbuf enables queing multiple writes at any time. It can be used for increasing overall I/O performance. Two assertions are put in code: 1) on_handshake_complete() expects waitbuf to be empty. That is, there should be no write operation while another write is in flight in handshake phase. 2) h2o_socket_write() expects waitbuf to be empty . Note that output may not be empty at h2o_socket_write() since pending waitbuf is moved to output at the write completion callback.
|
First commit should always work in handling renegotiation case. Let's think of situation that peer A receives renegotiation request from peer B. But I can think of following imaginary scenario:
It's not likely that [FOO]'s completion function to be delayed so much, but it can be possible. Yes, I'm reading and tinkering with some parts of you code. I like your approach of timer handling in event loop. Iibh2o is already too big to use it as a whole to me. |
|
Thank you for the fix. The code looks fine to me. My understanding is that your fix has actual value, since client-initiated renegotiation may occur while server is sending data. Do you have any proposal for exposing renegotiation layer to libh2o and the standalone server? At least we should have the following:
I can work for them, but I would appreciate it if you could come up with a PR. |
|
Thanks for a review. Supporting client authentication feature on h2o requires some work and Regards, |
|
My pleasure.
I understand. Thank you for your help anyways in providing the PR. I believe your contribution will help us implementing client authentication to h2o. |
|
Client certificate authentication is widely used in eGovernment and online banking services in Europe. Implementing this feature will allow using h2o in such environments. |
To support renegotiation, it is sufficient to flush write buffer
when write operation is happened in SSL_read().