Comments (15)
Hello,
Yes you would only need to replace ssl.c with another implementation. Then we could add some ifdefs and make a folder, etc.
from usockets.
I'm starting on it... Question: Is it OK with you if I implement it in C++ (but of course making all the required functions extern "C"
)? I haven't coded in plain C in years, and it's kind of painful.
from usockets.
Temporarily yes, it shouldn't be that hard to rewrite it in C later on
from usockets.
I’ve gotten it working enough to open a TLS client connection and do an HTTP GET. Next I’ll test the server side and then try a more interactive protocol.
I’m a bit unclear about the division of labor between the loop, context and socket objects. In your implementation, what led you to store data in one vs another? In particular, storing data in a loop rather than a socket. I may have to arrange things somewhat differently in my code because mbedTLS doesn’t allow a single TLS context to be used for both server and client sockets.
Also, what is copying contexts used for?
from usockets.
What kind of error info are you thinking about? I do not want to expose 57 different system specific errors.
from usockets.
(Nevermind about the errors, above; I shouldn't have sidetracked this issue! Filed #61 and deleted the equivalent comment above. I'll reply on the other issue's thread.)
I am still curious about the division of labor between loop/context/socket. You're registering the BIO callbacks at the loop level, which then means other fields related to I/O are stored at the loop level although they're really socket-specific. Is this a memory optimization based on the knowledge that the BIO functions are always called (indirectly) from the owning loop so there's no concurrency problem?
from usockets.
Yes the same BIO is shared among all SSL. Put as much as possible in the loop then add much as possible in the context then add little as possible in the socket. It's entirely single threaded
from usockets.
Closing due to inactivity
from usockets.
You mind sharing the code you have so far? I would like to check it against OpenSSL
from usockets.
Sure -- https://gist.github.com/snej/a9cde8eb3f8ee0d228898f8715bb4f26
from usockets.
Kool, thanks
from usockets.
Sure -- https://gist.github.com/snej/a9cde8eb3f8ee0d228898f8715bb4f26
Could you give me a copy code with mbedtls usockets? I want to use usockets with mbedtls too.
from usockets.
I posted the code I had. I don't use this library anymore, so I don't have anything stable, sorry.
from usockets.
Btw, how is mbedTLS compared to OpenSSL, WolfSSL? Are there any benchmarks?
from usockets.
Every post, benchmark points towards mbedtls being complete shit in performance.
It has cleaner interfaces but performs really bad, the devs don't even care that they haven't added hardware accelerated support on ARM which makes it 10x slower than OpenSSL
from usockets.
Related Issues (20)
- Consider `sendto$NOCANCEL` on macOS to avoid EINTR
- When Abnormal Interruption,Could lead to use after free HOT 1
- please remove the dllexport of static libs HOT 6
- 0.8.2 fails to build on FreeBSD: use of undeclared identifier 'IP_PKTINFO'
- Incompatible releases >=v20.18.0 + v0.8.2
- src/bsd.c:148:66: error: use of undeclared identifier 'IP_PKTINFO' HOT 1
- Only up to 1017 tcp clients are accepted when using epoll HOT 3
- Weird error when using ARM64 arch HOT 1
- Extremely low performance and double free HOT 9
- "src/internal/internal.h:119:5: error: unknown type name 'uint32_t'" When building with boost.asio
- Rewrite in Rust
- Zig experiment ? HOT 1
- [regression in 0.8.6] error: use of undeclared identifier 'IP_PKTINFO' HOT 1
- Compile static library on windows HOT 2
- Error initializing structure msg_hdr by UDP, field msg_name
- us_socket_context_connect timeout HOT 6
- Server fails to bind localhost in container
- Memory leak in us_create_timer
- It is good, can it support CMakeLists.txt? HOT 1
- Tests fail to compile: error: comparison between pointer and integer ('void *' and 'int') HOT 2
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 usockets.