async function createGrpcServer(sslOptions, services) {
  const server = new grpc.Server()
  for (const [, service] of services.entries()) {
    server.addService(service.serviceDefinition, service.implementation)
  }

  const { authPairs } = sslOptions
  const credentials = grpc.ServerCredentials.createSsl(null, authPairs, false)

  return new Promise((resolve, reject) => {
    server.bindAsync('127.0.0.1:0', credentials, (err, port) => {
      if (err) {
        reject(err)
      }

      resolve({ port, server })
    })
  })
}
Creates a grpc server and returns once bound to a port.

Does not start the server.

@param {object} [sslOptions]
@param {Buffer | null} [sslOptions.ca]
@param {Array<{private_key: Buffer, cert_chain: Buffer}>} [sslOptions.authPairs]
@param {Array<{serviceDefinition: ServiceDefinition, implementation: object}>} services