dhbaird / easywsclient

A short and sweet WebSocket client for C++
MIT License
751 stars 204 forks source link

Addressing SSL support for easywsclient #92

Open Nolaan opened 4 years ago

Nolaan commented 4 years ago

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

natsusue commented 2 years ago

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

supsm commented 1 year ago

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.