-
Notifications
You must be signed in to change notification settings - Fork 262
Adding wolfSSL support as ngtcp2 crypto library and examples. #505
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
Conversation
…32a5e729eb5). - based on ngtcp2 PR ngtcp2/ngtcp2#505 - configure adapted to build against ngtcp2 wolfssl crypto lib - quic code added for creation of WOLFSSL* instances
It looks like root CMakeList.txt lacks wolfSSL detection. |
Me and But let me give this a try... |
wolfSSL provides pkgconifg file, so it is relatively easy to deal with.
If you have hard time or no time to deal with cmake, then leave it to me. |
Always willing to learn. I have installed all my quic related libs in |
cmake understands PKG_CONFIG_PATH environment variable. List the custom install path in the variable. Then cmake will search them first. |
With the above comments, I can successfully compile the patch. After some tries of client and server, wsslclient works regular connection (nice!). But it is unable to send 0-RTT. I built wolfssl with the following configure options: --enable-quic --enable-session-ticket --enable-earlydata --enable-alpn |
Right, --enable-all fixes ALPN issue. |
wsslserver has some issues on resumption. |
Manual testing or do you have some scripting? |
I use ngtcp2 examples/client to test resumption and 0 RTT. |
Thanks. Can reproduce. |
cmake is now working on my machine. please check. |
I think I isolated the problem in wolfSSL that leads to failures in resumption with an openssl client. See wolfSSL/wolfssl#5452 for the PR that demonstrates the problem and a possible solution. |
It sounds like the same behavior as boringssl does. ngtcp2/crypto/boringssl/boringssl.c Line 428 in 26b0d3c
boringssl SSL_do_handshake returns 1 when it sends server finished to read early data from client. It provides SSL_in_early_data function to determine the actual TLS handshake completed or not. ngtcp2 boringssl binding uses it to decide whether keep calling SSL_do_handshake or not. |
Thank you. cmake now works for wolfssl binding library. |
Yes, indeed. wolfSSL merged my addition of a In my local testing, openssl example client resumes against wolfssl server and early data seems to work as well. |
Yeah, it is much better now. It seems that wolfssl server only accepts early data if wolfSSL_read_early_data is called. Inside it, it setups ssl->earlyData = expecting_early_data. QUIC does not use the function. Needs to do this somewhere. |
While I was playing around wolfSSL server 0RTT, it looks like it sends early_data extension even if it rejects resumption. |
I am wrestling with it. Seems that feature could do with some more attention. |
Ok, just created wolfSSL/wolfssl#5458 which in my tests with openssl/wolfssl based client/server examples here no longer rejects early data. No changes necessary to this PR other than the git change id update after wolfSSL merged. |
Yes, the PR has been merged, and I confirmed that 0RTT now works for both wsslclient and wsslserver. Thank you very much. The remaining issue is when wsslserver receives a session ticket which it cannot resume. |
It is interesting that the disagreement of keys happens if session ticket has not been expired yet (you can trigger this condition by restarting server, and use the ticket that the old server issued). After some time, I guess that the ticket has been expired, now both parties agree with the keys, but server still sends early_data extension in full handshake. OpenSSL does not like this and issues TLS alert. |
The issue mentioned above happens with regular TLSv1.3 connection over TCP.
Now I get After some time, do step 5 and 6 (needs step 5 because wolfssl example server stops as a result of step 6) and I get It seems that these are not QUIC specific. I'm not sure how the fix impacts the QUIC stuff, but I think we can go ahead and just polish up the current PR and merge it. |
Nice find. I will try to reproduce and then open an Issue at wolfSSL about it.
Excellent! Many thanks for the fast testing. I'll polish based on your feedback and rebase/squash afterwards. |
- adding --with-wolfssl as configure option - adding cmake support - adding examples/wsslclient and examples/wsslserver using the wolfssl ngtcp2 crypto library
Sorry, for having to stumble across all my leftovers. |
Reported the resumption problem as wolfSSL/wolfssl#5463. |
Thank you for fixing all issues. Now LGTM. |
- based on ngtcp2 PR ngtcp2/ngtcp2#505 - configure adapted to build against ngtcp2 wolfssl crypto lib - quic code added for creation of WOLFSSL* instances Closes #9290
UPDATE: PR opened. |
It requires this ngtcp2 commit, or newer: ngtcp2/ngtcp2@f0b46cf There is no tagged release with it yet. ngtcp2 doesn't seem to install two necessary headers, so we do it manually for the time being. Ref: ngtcp2/ngtcp2#505 (comment)
- based on ngtcp2 PR ngtcp2/ngtcp2#505 - configure adapted to build against ngtcp2 wolfssl crypto lib - quic code added for creation of WOLFSSL* instances Closes #9290
QUIC support has been added to wolfSSL (commit fa979230050dde47f6ac084c6f3b232a5e729eb5)
and ngtcp2 bindings are done as a separate crypto library.
wolfssl has been added as option to configure.
wolfssl based example client/server are build when configured
and have been verified to work against google/cloudflare/fastly
servers.