protected function validate()
{
// verify we have a host address and port
if (!$this->config->getHost() || !$this->config->getPort()) {
throw new Node\Builder\Exception('Node host address and port number are required.');
}
if ($this->config->getUser() && $this->config->getCertificate()) {
throw new Node\Builder\Exception('Connect with password OR certificate authentication, not both.');
}
if ($this->config->isAuth() && !$this->config->getCaDirectory() && !$this->config->getCaFile()) {
throw new Node\Builder\Exception('Certificate authority file is required for authentication.');
}
}