easywsclient icon indicating copy to clipboard operation
easywsclient copied to clipboard

Addressing SSL support for easywsclient

Open Nolaan opened this issue 4 years ago • 2 comments

Add secureSocket class, modify Makefile to compile with SSL and C++20.

Hello, First of thanks very much for the client, it saved me lots of time and is amazingly simple to use. However I've came accross an hurdle as many servers require SSL nowadays. I added openssl by adding a new class. I've read #29 before submitted my PR and adjusted the code in regards. Please let me know what to change. I also hope this will help people with #39

Regards

Nolaan avatar Mar 10 '20 16:03 Nolaan

Hello, class secureSocket is a reasonable and excellent design, but in the poll(), if the client has not received a message, the function BIO_read() will block the thread, resulting in the inability to send messages. Maybe my usage is wrong, Hope you can check it out

natsusue avatar Aug 09 '22 12:08 natsusue

No offense, but honestly this pull request is a mess. The entire thing looks to be copied word for word from the SSL client example from the openssl wiki except for the handshake part, which the example left out. That looks like it's possibly paraphrased from the RFC or more likely wikipedia though I can't find the exact original source. Now, it's fine to copy code sometimes, but I find this quite appalling, especially since you didn't even bother to delete the original code (it's commented out), and the handshake code already exists, using different parameters.
As a result of the first instance of direct copying, the SSL code does not work on Windows at all, which you may have realized when you put the #ifdef USE_SSL block under #else (!_WIN32). As stated in #35, someone put hard work into windows compatibility, and it is a shame if that effort is lost.
I understand that @dhbaird is not super active in this repo anymore, but I think this pull request should be closed. If nothing else it'll save other people, who, like myself, thought that this pull request was functional and high-quality, and decided to drop it into their project. Again, it may be fine for your own uses, but for a library like easywsclient, I do not believe your code to be of enough quality.

Final note to those who are considering using this: please don't, for the reasons outlined above.

supsm avatar Jul 18 '23 04:07 supsm