Skip to the content.

CONNECT

← Back to Home - To Transport


The CONNECT packet is sent immediately after a client connected to a server. The connect handshake is used to exchange session keys and to verify the identify of the server (the client stays anonymous). Optionally, you can upgrade to an encrypted connection using the CONNECT. A CONNECT packet is not encrypted, unless you are using Plabble over TLS. The CONNECT packet has no request header fields and no response header fields.

Request

Connect request bytemap

Figure A: Connect request byte-map (body)


When you want to initiate a session you need no send a CONNECT request packet (see Figure A) to a server. The request packet contains the following data:

The connect packet has two flags:

Response

Connect response bytemap

Figure B: Connect response bytemap


The response that is sent back by the server (see Figure B) contains the following data:

The certificate contains the following fields:

Besides the data, the response is also indicated by a status code. You might encounter the following error codes:

Process and data flow

Connect process

Figure C: Connect process flow


The CONNECT process (see Figure C) works as follows:

  1. The client generates a new, random X25519 keypair and stores this for the session.
  2. The client sends the protocol version and the public key to the server in a CONNECT request packet. If the client wants to upgrade to an encrypted connection or to receive the signature, it sets the flags in the packet
  3. The server verifies the protocol version. If the protocol version is not supported, the server sends error code #2 Unsupported protocol version.
  4. The server also generates a new, random X25519 keypair.
  5. The server generates a shared secret from its private x25519 key and the public x25519 key received from the client
  6. The server stores the 32-byte shared secret for the session as session key.
  7. The server signs the entire client request + the x25519 public key from step 4 with the identity key (the private key associated with the certificate of the server).
  8. The server sends the x25519 key, the signature and optionally the certificate chain in a CONNECT response packet to the client.
  9. The client checks the certificate, if it was requested and provided. If requested but not provided or not valid, it aborts the connection
  10. The clients checks the signature the server had sent. It aborts the connection if the signature is not valid
  11. The client generates a shared secret from own public x25519 key and the x25519 key received from the server
  12. The client performs step 6 and stores the result
  13. The server and client are now connected

← Back to Home - To Transport - Next: CREATE packet