Comments (9)
Thanks for the good words.
If you can think of a generic way to handle that it would be good. Is it more focused on the client or on the server at this point ? Is your POC really complicated.
Apparently curl supports this, can you see how they do it ?
https://wiki.wireshark.org/TLS
from ixwebsocket.
The POC is pretty simple and can be compared against your master branch here: master...WSL-Ben:IXWebSocket:ssl-keylogfile
Not sure it's the best solution, but I can confirm that it works. Ensure you're using OpenSSL and set the tlsOptions.keyLogFile
and you should see the keys written out to the specified location.
from ixwebsocket.
Code is pretty simple, can you explain why you need the mutex and the global variable ?
from ixwebsocket.
Not really. Being honest, I have no idea what I'm doing and just kind of stopped once it worked.
Regarding the mutex, I was under the impression that due to multiple SSL contexts existing and being used in different threads that I'd need to protect it from a race condition. Sounds like I might have been wrong.
from ixwebsocket.
lol it's fine not to be sure ... programming is hard :)
There should be one context by IXSocket object already, so I'm confident we don't need the mutex.
from ixwebsocket.
Ok, I've dropped the mutex and replaced the global variable with a static class member. Thanks for the direction, I always appreciate an opportunity to learn.
from ixwebsocket.
from ixwebsocket.
The callback for OpenSSL needs to be static in order to match the expected callback signature. It also doesn't accept a void*
callback, which in my limited experience means that it won't really be possible to store it as a member variable, at least not in a way where it's accessible to the callback - though I'll be happy to find I'm incorrect as I've used this pattern in the past and find it less than ideal.
To clarify on the feature as well, I don't think there is any necessity to support the SSLKEYLOGFILE environment variable, simply to expose it as an option via the TLSOptions class.
I've also noticed with my patch that the first SSL key is written out, but subsequent ones fail to either call the callback or find a mapping from the SSL context to the filename. Are SSL context's designed to last the lifetime of the connection?
from ixwebsocket.
from ixwebsocket.
Related Issues (20)
- Cannot link against IXWebsocket HOT 1
- HTTPServer questions? HOT 2
- Question about weak_ptr in API HOT 1
- Source code release v11.4.4 contains an error in IXSocketMbedTLS.cpp line 52 HOT 3
- Can I use IXHttpClient to upload files to server? HOT 1
- each http request cause socket reconnection HOT 1
- [BUG] Does not receive a close or error message. and the mapping configured in the host file does not take effect
- Memory leak in proxy code HOT 4
- Universal Windows application TLS certificate issue HOT 2
- UWP App undefined method PathMatchSpecA HOT 2
- Client connection closed immediately on re-connection after ping timeout HOT 1
- Disable ZLIB when install as vcpkg package? HOT 1
- Build error. (mbedtls) HOT 2
- Unable to connect to ws endpoint behind standard AWS load balancer (ALB) HOT 8
- CMake packaging doesn't support example usage HOT 2
- Possible unintentional copying inside Websocket#connect function
- Possible unintentional copying inside Websocket#connect function HOT 1
- [enhancement] add ability to remove default headers HOT 2
- A check for 8-byte atomics is needed, as 32-bit platforms may require `libatomic` linking 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 ixwebsocket.