This code is SFS's Unity sample code - that is, just a proof of concept. The server is SFS 2.13.0.
Here are the things I've done.
* Enabled encryption in the zone configuration (<isEncrypted>true</isEncrypted>)
* Originally with a Let's Encrypt certificate, and then later with one for which I popped 30 euros.
* Certificates are imported into a JKS keystore and placed in lib/jetty/etc. lib/jetty/start.d/ssl.ini is updated accordingly.
Upon SFS startup I can connect with the openssl command line tool and see the certificate etc.
From Unity I'm trying to login using the sample client (Connector.cs). If I disable encryption it works just fine. The moment I add a listener, it fails.
Code: Select all
if (useEncryption) {
sfs.AddEventListener (SFSEvent.CRYPTO_INIT, OnCryptoInit);
}
And this in the OnConnection handler:
Code: Select all
if (useEncryption) {
trace("Initializing Crypto");
StartCoroutine(sfs.InitCrypto ());
} else {
enableInterface ("LOGIN");
uiState = 2;
}
And this is the OnCryptoInit:
Code: Select all
private void OnCryptoInit(BaseEvent evt) {
trace("Crypto Initialized?");
if ((bool) evt.Params["success"]) {
trace("....YES!");
enableInterface ("LOGIN");
uiState = 2;
} else {
trace("Encryption initialization failed: " + (string)evt.Params["errorMessage"]);
}
}