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

TLS/HTTPS (semi) support #265

Closed
wants to merge 3 commits into from
Closed

TLS/HTTPS (semi) support #265

wants to merge 3 commits into from

Conversation

dobby5
Copy link
Contributor

@dobby5 dobby5 commented May 23, 2021

HTTPS currently not yet supported
* OpenSSL Support - [issue39](https://github.com/getnamo/socketio-client-ue4/issues/39), temporary [workaround available](https://github.com/getnamo/socketio-client-ue4/issues/72#issuecomment-371956821).
HTTPS is only supported through a little change in the source code.
* OpenSSL Support - <a href="https://github.com/dobby5/socketio-client-ue4/blob/0d3420f626704802d457e125bf01d0d4d26bbfe3/Source/SocketIOLib/SocketIOLib.Build.cs#L63-L73">Remove this declaration and compile the code, that's all.</a>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a merge please change this line with your branch @getnamo

@getnamo
Copy link
Owner

getnamo commented May 23, 2021

I'm not a fan of overriding SSL support by dropping non-ssl as that mode is far more common in use case. What can be done is to merge this into a ssl branch until we figure out a way to swap support via url lookup (https -> ssl, http-> standard)

@getnamo
Copy link
Owner

getnamo commented May 23, 2021

added merge to secondary branch here: https://github.com/getnamo/socketio-client-ue4/tree/ssl

@getnamo
Copy link
Owner

getnamo commented May 23, 2021

open future pull requests there until we manage to support both methods and it becomes ready for master

@getnamo getnamo closed this May 23, 2021
@dobby5
Copy link
Contributor Author

dobby5 commented May 23, 2021

I thing it is possible to including a variable at the said places, but I see the problem mainly at the place https://github.com/getnamo/socketio-client-ue4/blob/d0cad0135c1aca1ea4d891697c21f96767741fc0/Source/SocketIOLib/Private/internal/sio_client_impl.h#L38-L62, in the inclusion of the SSL or non-SSL hpp data.

@getnamo
Copy link
Owner

getnamo commented May 23, 2021

Yeah we'd need a different handler for on_message in tls variant https://github.com/getnamo/socketio-client-ue4/blob/d0cad0135c1aca1ea4d891697c21f96767741fc0/Source/SocketIOLib/Private/internal/sio_client_impl.cpp#L76 with the tls config, this can be changed on construction.

High level: On connect -> if mode is mismatching url, we'd re-create the lib client with correct mode and then connect. Each component has it's own client so we should be able to interweave tls and non tls connections

@dobby5
Copy link
Contributor Author

dobby5 commented May 24, 2021

Good morning, if I understand it correctly, your goal is basically to make these changes, right?

socketio/socket.io-client-cpp#137

@dobby5
Copy link
Contributor Author

dobby5 commented May 24, 2021

I have taken the changes from joelnordell and adapted them to the new version of our socket.io-client-cpp.

I still get an error with the "class/struct" maybe you have an idea how we can fix this.

I have pushed the changes into a new branch:
https://github.com/dobby5/socketio-client-ue4/tree/tls_testing

@getnamo
Copy link
Owner

getnamo commented May 24, 2021

Going to work on it within #267

At a first glance, I'm not fully convinced at the templated approach joelnordell did, seems unnecessarily complicated, but if it works, it could be a quick enough patch. Will know more later today.

@getnamo
Copy link
Owner

getnamo commented May 24, 2021

Got it to compile and pulled into https://github.com/getnamo/socketio-client-ue4/commits/ssl-dev

Emit still works, but receiving events broke, TBC.

Update: After seeing the current changes breaking on-receive without matching binding functions, I'm back to not being convinced a templated variant is the right approach. Will push this back one week and re-factor so it's easier to reason.

@dobby5
Copy link
Contributor Author

dobby5 commented May 26, 2021

Hello @getnamo,

I hope that we can find a quick fix for this. I will have a look at your changes during the day. Maybe you will find another approach to solution. I am also curious how you will solve it.

@dobby5
Copy link
Contributor Author

dobby5 commented May 27, 2021

@getnamo Do you have any news? Good and fast work by the way with the UE5 update.

@getnamo
Copy link
Owner

getnamo commented May 27, 2021

Still pushing the SSL refactor for next week (it's a lot more involved than the ue5 upgrade) as I'm out of time for sio this week. Will know more then.

@dobby5
Copy link
Contributor Author

dobby5 commented May 30, 2021

Okay good

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.

2 participants