znc-push icon indicating copy to clipboard operation
znc-push copied to clipboard

Use CURL in non-blocking mode

Open md-5 opened this issue 10 years ago • 5 comments

Note: You are strongly encouraged to use libcurl transport. The reason for that is, that the default CSocket transport doesn't verify server's SSL certificate which leaves you vulnerable to MITM attacks. However, use of libcurl will block the main ZNC thread at every push notification; for installations with many users, libcurl is not yet ideal, even with the above security concerns in mind.

This would fix the caveat and allow it to become usable for everyone.

md-5 avatar Jan 17 '15 06:01 md-5

CSocket transport doesn't verify server's SSL certificate which leaves you vulnerable to MITM attacks.

Is there an issue about this at CSocket?

Mikaela avatar Jan 17 '15 07:01 Mikaela

CSocket transport doesn't verify server's SSL certificate which leaves you vulnerable to MITM attacks.

That was actually added recently, not sure if it was added to ZNC or CSocket directly though

md-5 avatar Jan 17 '15 23:01 md-5

The releated commits that I can find are https://github.com/jimloco/Csocket/commit/78a81945b7638b3df74d3a7ebeee0288331b2d73 and https://github.com/jimloco/Csocket/commit/1b96a7b1c0a7481ee353a1aed570dd7e4fbf3fca but I am not sure how to read them.

Mikaela avatar Jan 18 '15 07:01 Mikaela

The problem with using the non-blocking curl API is that it requires a mechanism for dealing with async within the context of ZNC plugin execution, which afaik is not possible, or at least not simple, due to everything running on the main ZNC thread. And considering the small amount of time I have for working on this project, I would greatly prefer to spend it improving the python branch instead.

However, if you or someone else would be interested in implementing these improvements, I would be more than happy to review a pull request. :)

amyreese avatar Jan 26 '15 18:01 amyreese

async python in ZNC doesn't fly at all. As soon as ZNC leaves the event execution context it freezes all python threads.

md-5 avatar Jan 26 '15 22:01 md-5