private void ValidateConfig(TLSConfig config)
{
if (string.IsNullOrWhiteSpace(config.peerCertFilePath) || string.IsNullOrWhiteSpace(Path.GetFullPath(config.peerCertFilePath)))
{
throw new Exception("Invalid Trusted Certificate File Path");
}
if (string.IsNullOrWhiteSpace(config.localCertFilePath) || string.IsNullOrWhiteSpace(Path.GetFullPath(config.localCertFilePath)))
{
throw new Exception("Invalid Certificate File Path");
}
if (string.IsNullOrWhiteSpace(config.privateKeyFilePath) || string.IsNullOrWhiteSpace(Path.GetFullPath(config.privateKeyFilePath)))
{
throw new Exception("Invalid Private Key File Path");
}
if (!(config.allowTLSv10 || config.allowTLSv11 || config.allowTLSv12))
{
throw new Exception("At least one TLS version must be selected");
}
}