Skip to content

Beginning the connection

Esteban Chacon Martin edited this page Aug 20, 2022 · 1 revision

The client starts the connection by sending the version of the protocol that it expects to use. The exact string of this depends of the configuration of the protocol. There is no restriction to numbers. Once the server validates the protocol version it responds with a command status or an error condition.

OK for approved.

FAILED 2 : Incompatible protocol.

If the server returns with a failure status it has three parts. The string FAILED which indicates an error. The number after one space character could be used to identify the error with integer type so there is no need to parse the following string. The next string after the number is a text that describes, mostly for debug purpose, the nature of the error.

This dynamic of sending commands from client and once the server processes it, it returns an exit status, it repeats for every command of the protocol. There is one exception, some command may not indicate and error code and the string indicating the error.

After the server validates the protocol version and sends back to the client the OK command, it goes to wait again, it is time for the public key of the client to start the encryption system. If the protocol validation fails the connection is terminated by the server.