diff --git a/Transports/com.community.netcode.transport.websocket/Runtime/WebSocketTransport.cs b/Transports/com.community.netcode.transport.websocket/Runtime/WebSocketTransport.cs index 11c48bdb..6a1975cb 100644 --- a/Transports/com.community.netcode.transport.websocket/Runtime/WebSocketTransport.cs +++ b/Transports/com.community.netcode.transport.websocket/Runtime/WebSocketTransport.cs @@ -19,6 +19,7 @@ public class WebSocketTransport : NetworkTransport public bool SecureConnection = false; public bool AllowForwardedRequest; public string CertificateBase64String; + public string CertificatePassword; public override ulong ServerClientId => 0; @@ -135,7 +136,8 @@ public override bool StartServer() if (!string.IsNullOrEmpty(CertificateBase64String)) { var bytes = Convert.FromBase64String(CertificateBase64String); - WebSocketServer.SslConfiguration.ServerCertificate = new X509Certificate2(bytes); + if(string.IsNullOrEmpty(CertificatePassword)) WebSocketServer.SslConfiguration.ServerCertificate = new X509Certificate2(bytes); + else WebSocketServer.SslConfiguration.ServerCertificate = new X509Certificate2(bytes, CertificatePassword); } WebSocketServer.Start();