Handshake problem when connecting to local server

I have put my local server key into the particle photon and also put the particle photon public key into server core_keys folder, I can see the new public key in the folder.

However, when conected to my local server, I received the error shown below which have seen it never before.

Handshake failed: plaintext was the wrong size: 214 { ip: ‘192.168.43.11’, cache_key: ‘_15’, coreID: null }

I have updated the latest spark-protocol, but still suffered from the problem.

see: https://github.com/spark/spark-server/issues/45

I can connect the local server now by commenting

//plaintext should be 52 bytes, else fail
if (plaintext.length != (Handshake.NONCE_BYTES + Handshake.ID_BYTES)) {
that.handshakeFail("plaintext was the wrong size: " + plaintext.length);
return;
}

it works but I wonder what is the use of this part of code, what happens if I comment this part.

1 Like