Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TLS/SSL Support #304

Merged
merged 1 commit into from
Apr 8, 2022
Merged

Add TLS/SSL Support #304

merged 1 commit into from
Apr 8, 2022

Conversation

mikeseese
Copy link
Contributor

@mikeseese mikeseese commented Apr 7, 2022

This PR is a combination of work from @dobby5, @joelnordell, @getnamo, and myself to add TLS/SSL support. Thanks everyone for their work and support! Unfortunately due to a lot of whitespace changes and merge conflicts, this PR removed individual commits in favor of a simple squashed commit without the majority of the whitespace changes.

With this PR:

  • Fixes Add OpenSSL support #39
  • TLS/SSL support works without recompiling to turn it on/off. You compile once with SIO_TLS=1 (enabled with this PR), and users can easily enable/disable the TLS functionality with a boolean flag
  • Due to the structure of the classes and their various usages, to use TLS/SSL, a user must enable bShouldUseTlsLibraries on the SocketIOClientComponent. It was tricky to implement a smart detection based off the host's scheme (http vs https / ws vs wss) due to the class initialization and connection flexibility.
  • Certificate verification is not implemented, but the foundation of adding support has been added with the idea that the user must specify the CA Chain (perhaps via a file path or copy/paste the whole chain contents in a string field). Add support for TLS/SSL certification verification #303 will track implementation of this feature. Implementation is not on my personal near-term roadmap (but likely one day)
  • The new TLS/SSL requirements bumps up the recommended socket.io server version from 1.4+ to 3.0+. A compatibility table was added to properly document what versions of the plugin work with which socket.io server versions. @getnamo should update README.md, line 48 to reflect the actual version this change gets published in.

If requested, I can provide a NodeJS script that can be used for testing purposes.

@mikeseese mikeseese mentioned this pull request Apr 7, 2022
@getnamo
Copy link
Owner

getnamo commented Apr 8, 2022

At a glance there is one or two API changes I might make, but this is amazing. I'll do a review shortly and fix any API changes in post.

@getnamo
Copy link
Owner

getnamo commented Apr 8, 2022

Do provide the NodeJs script as a gist link if possible

@getnamo getnamo merged commit e1ceb9f into getnamo:master Apr 8, 2022
getnamo added a commit that referenced this pull request Apr 8, 2022
@getnamo
Copy link
Owner

getnamo commented Apr 8, 2022

This passed the http tests without code changes which is good enough for merge. Only API change for now was to add default values to 0c6d390. Will adjust API more at a later point.

@getnamo
Copy link
Owner

getnamo commented Apr 8, 2022

Again awesome work, this has been the longest and most prominent missing feature of the plugin!

NB: If you do share the gist, I'll be able to add the https tests in my rounds.

@getnamo
Copy link
Owner

getnamo commented Apr 8, 2022

Minor note, plugin has been using v4 lib since plugin v1.6.0. Updated tables in readme to reflect this.

@getnamo
Copy link
Owner

getnamo commented Apr 8, 2022

Added a quick documentation snippet at https://github.com/getnamo/SocketIOClient-Unreal#httpsssl, you can doublecheck that section has accurate information on your current API.

@getnamo
Copy link
Owner

getnamo commented Apr 8, 2022

Release incorporating this made here: https://github.com/getnamo/SocketIOClient-Unreal/releases/tag/v2.1.0

@dobby5
Copy link
Contributor

dobby5 commented Apr 8, 2022

@seesemichaelj it looks very good 🤗 Thank you for your incredible work.

@mikeseese
Copy link
Contributor Author

@getnamo here's the gist: https://gist.github.com/seesemichaelj/6b6f566b78e516aa2586c4f6148061bb

@mikeseese mikeseese deleted the ssl-squash branch April 8, 2022 04:43
@getnamo
Copy link
Owner

getnamo commented Apr 8, 2022

Had to modify the gist a tiny bit (resolve/reject didn't work on my node, likely need to update it), but it was enough to verify TLS functionality, stellar work. Fixed defaults (0d9b549) and expanded documentation a bit (https://github.com/getnamo/SocketIOClient-Unreal#httpstlsssl-support). Btw I really appreciated the comments on the public functions and properties for the new API.

@getnamo
Copy link
Owner

getnamo commented Apr 19, 2022

API modified in v2.3.0, it now supports TLS based purely on URL. Changed SSL toggle to optional forcing parameter.

johsuacarter added a commit to johsuacarter/Unity-Game-Socket-IOClient-Unreal that referenced this pull request Sep 5, 2022
bradleythomas1223 added a commit to bradleythomas1223/Unreal-Socket-IO-Client that referenced this pull request Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add OpenSSL support
3 participants