Skip to content

Commit 0b5d35e

Browse files
author
yinlong
committed
fix ssl bug
1 parent a8dd390 commit 0b5d35e

File tree

1 file changed

+5
-2
lines changed
  • UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket

1 file changed

+5
-2
lines changed

UnityWebSocket/Assets/Scripts/Plugins/UnityWebSocket/WebSocket.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Text;
@@ -197,7 +197,10 @@ public WebSocket(string address)
197197
onMessage(this, new MessageEventArgs((Opcode)e.Opcode, e.RawData));
198198
};
199199

200-
m_rawSocket.SslConfiguration.EnabledSslProtocols = (System.Security.Authentication.SslProtocols)((int)m_rawSocket.SslConfiguration.EnabledSslProtocols | 192 | 768 | 3072);
200+
if (m_rawSocket.IsSecure)
201+
{
202+
m_rawSocket.SslConfiguration.EnabledSslProtocols = (System.Security.Authentication.SslProtocols)((int)m_rawSocket.SslConfiguration.EnabledSslProtocols | 192 | 768 | 3072);
203+
}
201204
}
202205

203206
/// <summary>

0 commit comments

Comments
 (0)