function handshake (channel, log) {
  return initialHandshake(channel, log).then((result) => {
    if (result.protocolVersion === 255.1) {
      return handshakeNegotiationV2(channel, result.buffer, log)
    } else {
      return result
    }
  })
}
Shake hands using the channel and return the protocol version

@param {Channel} channel the channel use to shake hands
@param {Logger} log the log object
@returns {Promise<HandshakeResult>} Promise of protocol version and consumeRemainingBuffer