Conversation
|
I notice github actions's environment has no mbedtls, may I build mbedtls in CI too? |
|
You should be able to just add something like |
|
https://github.com/libevent/libevent/pull/1028/checks?check_run_id=712190097 |
It should, otherwise it will make build significantly slower (especially on CI) As a workaround for this PR you can change cache key |
bb89a55 to
bff1982
Compare
azat
left a comment
There was a problem hiding this comment.
In general looks good, but lots of copy-paste in bufferevent_mbedtls.c can you reduce it please? (and it is not only to make code clean but also bufferevent_openssl.c contains some quirks/issues that I would love to keep in one place to avoid out-of-sync problems)
I also think that current implementation is ugly, and need to reuse some logic from openssl. |
How about move generic code out from the bufferevent_openssl and use it for both openssl and mbedtls, thus you will avoid copy-pasting? |
there is a problem when reuse code with openssl and mbedtls. |
Sound ok, but this library should not be exported, only archive or cmake object |
|
If we don't export |
They will just both contains the same code in the library, this is how archive library works P.S. maybe I misunderstand you? |
|
I review code of |
Ok |
|
windows CI is OK all now, maybe you mistake link? https://github.com/libevent/libevent/actions/runs/168370501 |
azat
left a comment
There was a problem hiding this comment.
So this looks way more better in general right now, @okhowang thank you for being so patient!
There are some small bits left that I would prefer to fix before merge, I was going to do this by myself (to merge it faster), but if you want to address them by yourself (besides maybe you will have another opinion on that bits) give me a note and I will leave comments instead.
|
@okhowang Ok, will address those minor bits by myself |
prototype is libevent-2.1.11-stable libevent_openssl.c
Based on mbedtls's source code programs/ssl/ssl_client1.c
FindMbedTLS.cmake is come from https://github.com/AVSystem/avs_commons/blob/master/cmake/FindMbedTLS.cmake, which is licensed under Apache 2.0 alternatives: https://github.com/curl/curl/blob/master/CMake/FindMbedTLS.cmake without variable MBEDTLS_ROOT_DIR https://github.com/libgit2/libgit2/blob/master/cmake/Modules/FindmbedTLS.cmake GPLv2 with a special Linking Exception
This patch splits common part out to avoid copy-paste from the - bufferevent_openssl.c - bufferevent_mbedtls.c It uses VFS/bufferevent-like approach, i.e. structure of callbacks.
|
@okhowang thanks a lot for this functionality! BTW can you also add:
|
I will do it later. |
|
Plus there are also the following warnings: |
The bufferevent_get_openssl_error() returns unsigned long, so returning -1 on error in unclear. Let's use 0. Fixes: #1028
https-client is based on OpenSSL currently, |
@okhowang This will be okay too (if this will be done w/o copy-paste, or with minimal copy-paste) P.S. sorry for the delay |
This pure build w/o SSL has been removed in mbedtls PR - #1028
* ssl-fixes-after-mbedtls: Fix BEV_IS_SSL() macro Fix preprocessor condition for BEV_IS_SSL() Remove reduntant BEV_IS_MBEDTLS Refs: #1028
close #421
I based on boytm's work, and fix warning and error