public async Task <bool> AuthorizeAsync(X509Certificate certificate) { if (IsProtected) { return(true); } try { await ReadWriteSslStream.AuthenticateAsServerAsync(certificate, false, SslProtocols.Tls12, false); } catch (AuthenticationException) { return(false); } return(true); }
public bool Authorize(X509Certificate certificate) { if (IsProtected) { return(true); } try { ReadWriteSslStream.AuthenticateAsServer(certificate, false, SslProtocols.Tls12, false); } catch (AuthenticationException) { return(false); } return(true); }