Comments (4)
@paullouisageneau regarding
MBEDTLS_SSL_DTLS_SRTP
, is this understanding correct?
@chobie Yes you are right, MbedTLS needs to be compiled with DTLS SRTP support. It's often the case for packaged builds, but if you compile by yourself, you have to make sure it's enabled.
I had to keep this manually added lines of code in libdatachannel's CMakeLists
if (NOT DEFINED CMAKE_PREFIX_PATH) set(CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}\\deps\\mbedtls) else() set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${CMAKE_SOURCE_DIR}\\deps\\mbedtls") endif()
When building outside of an IDE, you can simply pass -DCMAKE_PREFIX_PATH=YOURPREFIX
for libdatachannel. I guess there may be a similar option in CLion.
after build go to directory "cmake-build-release" and from there copy move "library" and "include" directories into \deps\mbedtls
rename "library" to "lib"
open libdatachannel in clion, now when cmake is configuring project instead of errors there should be this
Same you shouldn't need to do this manually, outside of an IDE you simply pass -DCMAKE_INSTALL_PREFIX=YOURPREFIX
for MbedTLS, then you install it after the build, typically with make install
, and CMake will copy everything under the prefix in the right directories.
from libdatachannel.
I have not performed it works, but these are the build instructions for Windows 11.
Please refer to them.
# on Developer Command Prompt For vs2022
# C:\Users\USERNAME\github. please replace USERNAME to your account.
# make sure you've already cloned libdatachannel repository
git clone https://github.com/Mbed-TLS/mbedtls.git
cd mbedtls
git checkout v3.5.1
# IMPORTANT:
# You have to edit `include/mbedtls/mbedtls_config.h` to enable `#define MBEDTLS_SSL_DTLS_SRTP` constant (just uncomment that line).
# otherwise `mbedtls_dtls_srtp_info` cannnot find.
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="C:\\Users\\USERNAME\\github\\libdatachannel\\deps\\mbedtls" -DUSE_SHARED_MBEDTLS_LIBRARY=On -B build
cd build
nmake
nmake install
# then, result files will install `libdatachannel\deps\mbedtls` directories.
# after compile mbedtls, move to libdatachannel root directory
cd ..\..\
# use cmake command. the point is to specify mbedtls install path (specifically `DCMAKE_INSTALL_PREFIX`). not repository directory.
cmake -B build -G "NMake Makefiles" -DUSE_MBEDTLS=1 -DCMAKE_PREFIX_PATH="C:\\Users\\USERNAME\\github\\libdatachannel\\deps\\mbedtls"
A key point is that building MbedTLS alone does not result in the directory structure expected by FindMbedTLS
.
Therefore, I first configured the build of MbedTLS to install to the destination specified by DCMAKE_INSTALL_PREFIX
. and install that. Then, by specifying DCMAKE_PREFIX_PATH
in libdatachannel, I was able to resolve the references.
For the purpose of explanation, I specified the installation destination as the libdatachannel\deps
directory, but you can choose any location you prefer. (I believe I have corrected the path in the explanation, but I apologize if there was any mistake during the process of trial and error.)
@paullouisageneau regarding MBEDTLS_SSL_DTLS_SRTP
, is this understanding correct?
from libdatachannel.
I think that it's probably easier to use something like vcpkg
rather than building mbedtls yourself.
from libdatachannel.
problem solved for me
I had to keep this manually added lines of code in libdatachannel's CMakeLists
if (NOT DEFINED CMAKE_PREFIX_PATH)
set(CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}\\deps\\mbedtls)
else()
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${CMAKE_SOURCE_DIR}\\deps\\mbedtls")
endif()
steps
- open mbedtls with Clion
- select mbedtls | Release configuration (there are many configurations)
- build
[112/116] Building C object library/CMakeFiles/mbedtls.dir/net_sockets.c.obj
[113/116] Building C object library/CMakeFiles/mbedtls.dir/ssl_tls.c.obj
[114/116] Building C object library/CMakeFiles/mbedtls.dir/ssl_tls12_server.c.obj
[115/116] Building C object library/CMakeFiles/mbedtls.dir/ssl_tls12_client.c.obj
[116/116] Linking C static library library\libmbedtls.a
-
after build go to directory "cmake-build-release" and from there copy move "library" and "include" directories into \deps\mbedtls
-
rename "library" to "lib"
-
open libdatachannel in clion, now when cmake is configuring project instead of errors there should be this
-- Performing Test has_wno_address_of_packed_member - Success
-- Performing Test has_wno_deprecated_declarations
-- Performing Test has_wno_deprecated_declarations - Success
-- link library: ws2_32
-- Found MbedTLS: C:/Users/user/Desktop/libdatachannel/deps/mbedtls/lib/libmbedtls.a (found suitable version "3.5.1", minimum required is "3")
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
note both projects libdatachannel and mbedtls have to be build with same toolchain or linker wont be able to glue them together
suggestion: add mbedtls into libdatachannel by default (easiest to built)
from libdatachannel.
Related Issues (20)
- RtpPacketizationConfig not properly initialized HOT 2
- setLocalDescription's Init parameter may not work. HOT 3
- The push function of the sendQueue in DataChannel will trigger wait and can not be awaked. HOT 3
- Client xxx not found HOT 2
- WebSocket::path() returns nullopt when state is Connecting HOT 2
- Mixed up dynamic and static libjuice dependencies HOT 1
- Source directory requires read/write filesystem during build HOT 3
- C API lacking proper closure support HOT 4
- Lost connectivity after successful connection HOT 7
- WebSocketServer not stopping properly HOT 2
- How to troubleshoot when the onGatheringStateChange function returns very slowly? HOT 1
- Websocket disconnect HOT 2
- Trouble connecting via TURN server HOT 1
- Does libdatachannel support to compile in pure C Linux system(for some embedded device no support C++17)? HOT 3
- rtc::PeerConnection::close() causes the application to crash when called multiple times HOT 1
- Unable to retrieve negotiated media details HOT 2
- crash HOT 4
- Data channels created by createDataChannel in a multithreaded may occasionally lose events HOT 3
- Expose remote TLS certificate for WebSocket
- copy-paste-capi
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libdatachannel.