Skip to content

Commit c9d2076

Browse files
authored
Merge pull request #27 from IBM/feat/deprecate-tls10-warning
chore: add deprecation warning for tls1.0
2 parents 660cc37 + b640edf commit c9d2076

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Connection/WSConnector.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
//! Uncomment to enable message debugging
19-
//#define ENABLE_MESSAGE_DEBUGGING
19+
// #define ENABLE_MESSAGE_DEBUGGING
2020

2121
using IBM.Cloud.SDK.Logging;
2222
using IBM.Cloud.SDK.Utilities;
@@ -255,6 +255,7 @@ public static string FixupURL(string URL)
255255
// platforms.
256256
else if (URL.StartsWith("https://stream-tls10."))
257257
{
258+
Log.Warning("WSConnector", "Deprecated: Support for TLS 1.0 will be removed in the next major release of the SDK. Update to Unity version 2018.2 or later to support TLS 1.2.");
258259
URL = URL.Replace("https://stream-tls10.", "wss://stream-tls10.");
259260
}
260261
// Germany
@@ -283,7 +284,7 @@ public static string FixupURL(string URL)
283284
Log.Warning("WSConnector", "No case for URL for wss://. Replacing https:// with wss://.");
284285
}
285286
#else
286-
// Use TLS 1.0 endpoint if user is on .NET 3.5. US South is the
287+
// Use TLS 1.0 endpoint if user is on .NET 3.5. US South is the
287288
// only region that supports this endpoint.
288289
if (URL.StartsWith("https://stream."))
289290
{
@@ -305,10 +306,12 @@ public static string FixupURL(string URL)
305306
// US South is the only region that supports this endpoint.
306307
if (URL.StartsWith("https://stream."))
307308
{
309+
Log.Warning("WSConnector", "Deprecated: Support for TLS 1.0 will be removed in the next major release of the SDK. Update to Unity version 2018.2 or later to support TLS 1.2.");
308310
URL = URL.Replace("https://stream.", "wss://stream-tls10.");
309311
}
310312
else if (URL.StartsWith("https://stream-tls10."))
311313
{
314+
Log.Warning("WSConnector", "Deprecated: Support for TLS 1.0 will be removed in the next major release of the SDK. Update to Unity version 2018.2 or later to support TLS 1.2.");
312315
URL = URL.Replace("https://stream-tls10.", "wss://stream-tls10.");
313316
}
314317
else
@@ -360,7 +363,7 @@ public void Send(Message msg, bool queue = false)
360363
{
361364
#if ENABLE_MESSAGE_DEBUGGING
362365
Log.Debug( "WSConnector.Send()", "Sending {0} message: {1}",
363-
msg is TextMessage ? "TextMessage" : "BinaryMessage",
366+
msg is TextMessage ? "TextMessage" : "BinaryMessage",
364367
msg is TextMessage ? ((TextMessage)msg).Text : ((BinaryMessage)msg).Data.Length.ToString() + " bytes" );
365368
#endif
366369
lock (_sendQueue)
@@ -388,7 +391,7 @@ public void Send(Message msg, bool queue = false)
388391
}
389392
#endif
390393

391-
// Run our receiver as a co-routine so it can invoke functions
394+
// Run our receiver as a co-routine so it can invoke functions
392395
// on the main thread.
393396
if (_receiverRoutine == 0)
394397
_receiverRoutine = Runnable.Run(ProcessReceiveQueue());
@@ -423,7 +426,7 @@ private IEnumerator ProcessReceiveQueue()
423426
Message msg = _receiveQueue.Dequeue();
424427
#if ENABLE_MESSAGE_DEBUGGING
425428
Log.Debug( "WSConnector.ProcessReceiveQueue()", "Received {0} message: {1}",
426-
msg is TextMessage ? "TextMessage" : "BinaryMessage",
429+
msg is TextMessage ? "TextMessage" : "BinaryMessage",
427430
msg is TextMessage ? ((TextMessage)msg).Text : ((BinaryMessage)msg).Data.Length.ToString() + " bytes" );
428431
#endif
429432
if (OnMessage != null)

0 commit comments

Comments
 (0)