Skip to content

Commit

Permalink
* FIX [quic_api] Add some comments to some quic options.
Browse files Browse the repository at this point in the history
QUIC TLS cacertificate is supported.
  • Loading branch information
wanghaEMQ authored and JaylinYu committed Mar 21, 2023
1 parent 2700512 commit e6f5a44
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 42 deletions.
16 changes: 8 additions & 8 deletions src/mqtt/protocol/mqtt/mqtt_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,26 @@ struct conf_bridge_node {
static conf_bridge_node config_node = {
.tls = {
.enable = false,
.url = "",
.url = "", // Depracated
.cafile = "",
.certfile = "",
.keyfile = "",
.ca = "",
.cert = "",
.key = "",
.key_password = "",
.verify_peer = false,
.set_fail = false,
.verify_peer = true,
.set_fail = true,
},
.multi_stream = true,
.stream_auto_genid = true,
.qos_first = true,
.hybrid = false,
.multi_stream = false,
.stream_auto_genid = false,
.qos_first = false,
.hybrid = false, // Depracated
.qkeepalive = 30,
.qconnect_timeout = 60,
.qdiscon_timeout = 30,
.qidle_timeout = 30,
.qcongestion_control = 1, // bbr
.qcongestion_control = 0, // cubic
.max_send_queue_len = 32,
.max_recv_queue_len = 32,
};
Expand Down
43 changes: 10 additions & 33 deletions src/supplemental/quic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,16 @@ if (NNG_ENABLE_QUIC)
nng_sources(quic_api.c)
nng_sources(quic_api.h)

find_library(OPENSSLQUIC_LIBRARIES
NAMES openssl ssl libssl libopenssl
HINTS "${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl"
PATHS "${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl"
PATH_SUFFIXES lib)

find_library(CRYPTOQUIC_LIBRARIES
NAMES crypto libcrypto
HINTS "${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl"
PATHS "${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl"
PATH_SUFFIXES lib)

if(OPENSSLQUIC_LIBRARIES_NOTFOUND)
message("No openssl for MsQuic be found!")
elif(CRYPTOQUIC_LIBRARIES_NOTFOUND)
message("No openssl for MsQuic be found!")
else()
nng_include_directories(${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl/include)

set(SSLQUIC_LIBRARIES ${OPENSSLQUIC_LIBRARIES})
mark_as_advanced(SSLQUIC_LIBRARIES)
nng_link_libraries(${SSLQUIC_LIBRARIES})

set(SSLCRYPTO_LIBRARIES ${CRYPTOQUIC_LIBRARIES})
mark_as_advanced(CRYPTOQUIC_LIBRARIES)
nng_link_libraries(${CRYPTOQUIC_LIBRARIES})
endif()

#nng_include_directories(${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl/include)
#nng_link_libraries("${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl/lib/libssl.a")
#nng_link_libraries("${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl/lib/libcrypto.a")


# In sdk. use openssl from system
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIRS})
nng_link_libraries(OpenSSL::SSL OpenSSL::Crypto)
endif()

#nng_include_directories(${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl/include)
#nng_link_libraries("${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl/lib/libssl.a")
#nng_link_libraries("${CMAKE_SOURCE_DIR}/build/_deps/opensslquic-build/openssl/lib/libcrypto.a")

# set_property(CACHE NNG_QUIC_LIB PROPERTY STRINGS ${NNG_TLS_ENGINES})
else ()
Expand Down
1 change: 0 additions & 1 deletion src/supplemental/quic/quic_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,6 @@ void
quic_proto_set_sdk_config(void *config)
{
memcpy(&conf_node, config, sizeof(conf_quic_sdk));
log_info("-------------------------------------tls %d", conf_node.tls.enable);
}

void
Expand Down

0 comments on commit e6f5a44

Please sign in to comment.