question

Ziii avatar image
Ziii asked

SSL/WSS for multiplayer servers

Hi,

We have a webgl game that requires websocket secure connection with servers, which require all servers to have ssl certification.

I've seen some related threads from years ago, and i wonder if there is an easy way for doing this now.

There is an "upload certificate" setion while deploying new build, is it related to this issue?

Thanks.

multiplayer
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dimitris-Ilias Gkanatsios avatar image
Dimitris-Ilias Gkanatsios answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dimitris-Ilias Gkanatsios avatar image
Dimitris-Ilias Gkanatsios answered

Are you using Windows or Linux? Yeah, the UploadCertificate API is the one to use for Windows since it will install the cert on the registry. For Linux, you either use this API or bake it into your container image, in both cases it will end up as files you can utilize from your code.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ziii avatar image Ziii commented ·

I'm using Windows.
Can you elaborate on how to utilize the certificate for a secured websocket connection?


With my limited knowledge of SSL, I need a certificate for my domain and mapping the dynamic server IP to one sub-domain. Is this the only way of doing it?

0 Likes 0 ·
JayZuo avatar image JayZuo ♦ Ziii commented ·

How to utilize the certificate for a secured websocket connection is out of our scope. Based on the SDK/tools you are using, the implementation might be different. What we can help here is how to load the certificate. With Windows container, the certificate is installed under "Local Computer" → "Personal". If you are using C#, you can get it with the following code

string expectedThumbprint = initialConfig[GameCertAlias];
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certificateCollection = store.Certificates.Find(X509FindType.FindByThumbprint, expectedThumbprint, false);
if (certificateCollection.Count > 0)
{
    _installedCert = certificateCollection[0];
}

For more details, see https://github.com/PlayFab/MpsSamples/blob/master/WindowsRunnerCSharp/WindowsRunnerCSharp/Program.cs#L98.

1 Like 1 ·
Trevor Godley avatar image
Trevor Godley answered

@Zii did you end up solving this problem? I'm running into similar issues with my WebGL client. Playfab has the "Upload Certificate" option, but I don't know where or how to get a valid certificate to upload.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image Sarah Zhang commented ·
0 Likes 0 ·
zhangjunyu@mineloader.com avatar image
zhangjunyu@mineloader.com answered

I didn't get the answer. If I use a reverse proxy, why don't I just host the game directly on AWS?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.