public override uint EnableSsl(uint options)
{
_validateCert = (options & TdsEnums.SNI_SSL_VALIDATE_CERTIFICATE) != 0;
try
{
_sslStream.AuthenticateAsClientAsync(_targetServer).GetAwaiter().GetResult();
_sslOverTdsStream.FinishHandshake();
}
catch (AuthenticationException aue)
{
return ReportTcpSNIError(aue);
}
catch (InvalidOperationException ioe)
{
return ReportTcpSNIError(ioe);
}
_stream = _sslStream;
return TdsEnums.SNI_SUCCESS;
}