diff --git a/README.md b/README.md index 0e780249..581d7371 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Socket.IO Lib uses _asio_, _rapidjson_, and _websocketpp_. SIOJson is originally [Unreal Forum Thread](https://forums.unrealengine.com/showthread.php?110680-Plugin-Socket-io-Client) -Recommended socket.io server version: 1.4+. +Recommended socket.io server version: 3.0+ *Tip: This is a sizeable readme, quickly find your topic with ```Ctrl+F``` and a search term e.g. namespaces* @@ -22,8 +22,31 @@ Current platform issues: * Xbox/PS4 platform untested - see [issue 117](https://github.com/getnamo/socketio-client-ue4/issues/117) * Lumin platform untested - see [issue 114](https://github.com/getnamo/socketio-client-ue4/issues/114) -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 - Remove this declaration and compile the code, that's all. + +## Compatibility table + + + + + + + + + + + + + + + + + + + + +
UE4 Socket.IO plugin versionSocket.IO server version
1.x / 2.x3.x / 4.x
Up to tag 1.5.5YESNO
1.6+ (master branch)NOYES
## Quick Install & Setup ## diff --git a/Source/SocketIOLib/Private/internal/sio_client_impl.cpp b/Source/SocketIOLib/Private/internal/sio_client_impl.cpp index 1e2576b6..18bc91c3 100644 --- a/Source/SocketIOLib/Private/internal/sio_client_impl.cpp +++ b/Source/SocketIOLib/Private/internal/sio_client_impl.cpp @@ -629,7 +629,7 @@ namespace sio #if SIO_TLS client_impl::context_ptr client_impl::on_tls_init(connection_hdl conn) { - context_ptr ctx = context_ptr(new asio::ssl::context(asio::ssl::context::tlsv1)); + context_ptr ctx = context_ptr(new asio::ssl::context(asio::ssl::context::tlsv12)); asio::error_code ec; ctx->set_options(asio::ssl::context::default_workarounds | asio::ssl::context::no_sslv2 | @@ -639,6 +639,8 @@ namespace sio cerr << "Init tls failed,reason:" << ec.message() << endl; } + ctx->set_verify_mode(asio::ssl::verify_none); + return ctx; } #endif diff --git a/Source/SocketIOLib/Private/internal/sio_client_impl.h b/Source/SocketIOLib/Private/internal/sio_client_impl.h index 150324ed..90ec0783 100644 --- a/Source/SocketIOLib/Private/internal/sio_client_impl.h +++ b/Source/SocketIOLib/Private/internal/sio_client_impl.h @@ -36,16 +36,26 @@ #if defined(DEBUG) #if SIO_TLS - #include - typedef websocketpp::config::debug_asio_tls client_config; + #define UI UI_ST + THIRD_PARTY_INCLUDES_START + #include "openssl/hmac.h" + #include + typedef websocketpp::config::debug_asio_tls client_config; + THIRD_PARTY_INCLUDES_END + #undef UI #else #include typedef websocketpp::config::debug_asio client_config; #endif //SIO_TLS #else #if defined(SIO_TLS) - #include - typedef websocketpp::config::asio_tls_client client_config; + #define UI UI_ST + THIRD_PARTY_INCLUDES_START + #include "openssl/hmac.h" + #include + typedef websocketpp::config::asio_tls_client client_config; + THIRD_PARTY_INCLUDES_END + #undef UI #else #include typedef websocketpp::config::asio_client client_config; diff --git a/Source/SocketIOLib/SocketIOLib.Build.cs b/Source/SocketIOLib/SocketIOLib.Build.cs index 5c40d6d3..9474dd70 100644 --- a/Source/SocketIOLib/SocketIOLib.Build.cs +++ b/Source/SocketIOLib/SocketIOLib.Build.cs @@ -50,15 +50,27 @@ public SocketIOLib(ReadOnlyTargetRules Target) : base(Target) { "CoreUObject", "Engine", + "OpenSSL" } ); - - DynamicallyLoadedModuleNames.AddRange( + DynamicallyLoadedModuleNames.AddRange( new string[] { } ); + + /* + //Setup TLS support | Maybe other platforms work as well (untested) + if (Target.Platform == UnrealTargetPlatform.Win64 || + Target.Platform == UnrealTargetPlatform.Win32 || + Target.Platform == UnrealTargetPlatform.Mac || + Target.Platform == UnrealTargetPlatform.IOS + ) + { + PublicDefinitions.Add("SIO_TLS"); + } + */ } } } \ No newline at end of file