261 references to SR
System.Net.Security (261)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs (8)
55
SR
.Format(
SR
.net_gssapi_operation_failed_detailed, majorError, minorError) :
56
SR
.Format(
SR
.net_gssapi_operation_failed, majorStatus.ToString("x"), minorStatus.ToString("x"));
61
SR
.Format(
SR
.net_gssapi_operation_failed_detailed_majoronly, majorError) :
62
SR
.Format(
SR
.net_gssapi_operation_failed_majoronly, majorStatus.ToString("x"));
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (2)
34
throw new NetSecurityNative.GssApiException(
SR
.Format(
SR
.net_context_buffer_too_small, sourceLength, destinationAvailable));
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (34)
173
SR
.Format(
SR
.net_ssl_encryptionpolicy_notsupported, sslAuthenticationOptions.EncryptionPolicy));
183
SR
.Format(
SR
.net_ssl_encryptionpolicy_notsupported, sslAuthenticationOptions.EncryptionPolicy));
227
throw CreateSslException(
SR
.net_allocate_ssl_context_failed);
239
throw new SslException(
SR
.Format(
SR
.net_ssl_encryptionpolicy_notsupported, sslAuthenticationOptions.EncryptionPolicy));
255
throw new PlatformNotSupportedException(
SR
.Format(
SR
.net_ssl_encryptionpolicy_notsupported, sslAuthenticationOptions.EncryptionPolicy));
303
throw CreateSslException(
SR
.net_ssl_use_cert_failed);
342
throw CreateSslException(
SR
.net_ssl_use_cert_failed);
348
throw CreateSslException(
SR
.net_ssl_use_private_key_failed);
355
throw CreateSslException(
SR
.net_ssl_use_cert_failed);
421
throw CreateSslException(
SR
.net_allocate_ssl_context_failed);
454
throw CreateSslException(
SR
.net_alpn_config_failed);
657
throw CreateSslException(
SR
.Format(
SR
.net_ssl_set_sigalgs_failed, "server"));
663
throw CreateSslException(
SR
.Format(
SR
.net_ssl_set_sigalgs_failed, "client"));
782
handshakeException = new SslException(
SR
.Format(
SR
.net_ssl_handshake_failed_error, errorCode), innerError);
874
throw new SslException(
SR
.Format(
SR
.net_ssl_encrypt_failed, errorCode), GetSslError(retVal, errorCode));
991
throw new SslException(
SR
.Format(
SR
.net_ssl_decrypt_failed, errorCode), GetSslError(retVal, errorCode));
1020
throw CreateSslException(
SR
.net_ssl_get_channel_binding_token_failed);
1353
throw CreateSslException(
SR
.net_ssl_read_bio_failed_error);
1363
throw CreateSslException(
SR
.net_ssl_write_bio_failed_error);
1405
throw CreateSslException(
SR
.net_ssl_use_cert_failed);
1412
throw CreateSslException(
SR
.net_ssl_use_private_key_failed);
1420
throw CreateSslException(
SR
.net_ssl_check_private_key_failed);
1429
string msg =
SR
.Format(message, Utf8StringMarshaller.ConvertToManaged(Crypto.ErrReasonErrorString(errorVal)));
1456
: this(
SR
.Format(
SR
.net_generic_operation_failed, error))
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (4)
96
throw Interop.OpenSsl.CreateSslException(
SR
.net_ssl_get_default_sigalgs_failed);
332
throw new ArgumentException(
SR
.net_ssl_app_protocols_invalid, nameof(applicationProtocols));
339
throw new ArgumentException(
SR
.net_ssl_app_protocols_invalid, nameof(applicationProtocols));
589
throw Interop.OpenSsl.CreateSslException(
SR
.net_allocate_ssl_context_failed);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (1)
101
SR
.net_gssapi_ntlm_missing_plugin);
System\Net\CertificateValidationPal.cs (2)
81
NetEventSource.Error(null,
SR
.Format(
SR
.net_log_open_store_failed, storeLocation, exception));
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (4)
307
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null,
SR
.net_ntlm_not_possible_default_cred);
842
throw new InvalidOperationException(
SR
.net_auth_noauth);
862
throw new InvalidOperationException(
SR
.net_auth_noauth);
891
throw new InvalidOperationException(
SR
.net_auth_noauth);
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (5)
420
throw new InvalidOperationException(
SR
.net_auth_noauth);
430
throw new InvalidOperationException(
SR
.net_auth_noauth);
440
throw new InvalidOperationException(
SR
.net_auth_noauth);
450
throw new InvalidOperationException(
SR
.net_auth_noauth);
460
throw new InvalidOperationException(
SR
.net_auth_noauth);
System\Net\NegotiateAuthenticationPal.Unix.cs (5)
117
throw new PlatformNotSupportedException(
SR
.net_nego_server_not_supported);
200
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this,
SR
.net_ntlm_not_possible_default_cred);
201
throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_NO_CRED, 0,
SR
.net_ntlm_not_possible_default_cred);
205
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this,
SR
.net_nego_not_supported_empty_target_with_defaultcreds);
206
throw new Interop.NetSecurityNative.GssApiException(Interop.NetSecurityNative.Status.GSS_S_BAD_NAME, 0,
SR
.net_nego_not_supported_empty_target_with_defaultcreds);
System\Net\Security\AuthenticatedStream.cs (1)
24
throw new ArgumentException(
SR
.net_io_must_be_rw_stream, nameof(innerStream));
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (5)
27
throw new PlatformNotSupportedException(
SR
.net_ssl_ciphersuites_policy_not_supported);
34
throw OpenSsl.CreateSslException(
SR
.net_allocate_ssl_context_failed);
43
throw OpenSsl.CreateSslException(
SR
.net_allocate_ssl_context_failed);
145
throw new PlatformNotSupportedException(
SR
.net_ssl_ciphersuites_policy_not_supported);
166
throw new PlatformNotSupportedException(
SR
.net_ssl_ciphersuites_policy_not_supported);
System\Net\Security\NegotiateAuthentication.cs (19)
64
throw new PlatformNotSupportedException(
SR
.net_extprotection_not_supported);
184
throw new InvalidOperationException(
SR
.net_auth_noauth);
228
throw new InvalidOperationException(
SR
.net_auth_noauth);
333
throw new InvalidOperationException(
SR
.net_auth_noauth);
360
throw new InvalidOperationException(
SR
.net_auth_noauth);
388
throw new InvalidOperationException(
SR
.net_auth_noauth);
412
throw new InvalidOperationException(
SR
.net_auth_noauth);
437
throw new InvalidOperationException(
SR
.net_auth_noauth);
449
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this,
SR
.net_log_listener_no_spn_kerberos);
455
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this,
SR
.net_log_listener_no_spn_disabled);
461
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this,
SR
.net_log_listener_no_spn_cbt);
467
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this,
SR
.net_log_listener_no_spns);
477
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this,
SR
.net_log_listener_no_spn_whensupported);
482
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this,
SR
.net_log_listener_spn_failed_always);
487
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this,
SR
.net_log_listener_spn, clientSpn);
494
NetEventSource.Info(this,
SR
.net_log_listener_spn_passed);
498
NetEventSource.Info(this,
SR
.net_log_listener_spn_failed);
502
NetEventSource.Info(this,
SR
.net_log_listener_spn_failed_empty);
506
NetEventSource.Info(this,
SR
.net_log_listener_spn_failed_dump);
System\Net\Security\NegotiateStream.cs (38)
281
set => throw new NotSupportedException(
SR
.net_noseek);
288
throw new NotSupportedException(
SR
.net_noseek);
342
throw new NotSupportedException(
SR
.Format(
SR
.net_io_invalidnestedcall, "read"));
376
throw new IOException(
SR
.net_frame_read_size);
422
throw new IOException(
SR
.net_io_read);
445
throw new IOException(
SR
.net_io_read, e);
460
throw new IOException(
SR
.net_io_eof);
516
throw new NotSupportedException(
SR
.Format(
SR
.net_io_invalidnestedcall, "write"));
546
throw new IOException(
SR
.net_io_encrypt);
559
throw new IOException(
SR
.net_io_write, e);
613
throw new ArgumentException(
SR
.net_auth_must_specify_extended_protection_scheme, nameof(policy));
642
throw new InvalidOperationException(
SR
.net_auth_reauth);
652
throw new ArgumentOutOfRangeException(nameof(impersonationLevel), impersonationLevel.ToString(),
SR
.net_auth_supported_impl_levels);
657
throw new InvalidOperationException(
SR
.net_auth_client_server);
723
throw new InvalidOperationException(
SR
.net_auth_noauth);
735
throw new InvalidOperationException(
SR
.Format(
SR
.net_io_invalidnestedcall, "authenticate"));
775
new AuthenticationException(
SR
.net_auth_bad_client_creds_or_target_mismatch),
777
new AuthenticationException(
SR
.net_auth_bad_client_creds_or_target_mismatch),
779
new AuthenticationException(
SR
.Format(
SR
.net_auth_context_expectation, _expectedImpersonationLevel.ToString(), PrivateImpersonationLevel.ToString())),
781
new AuthenticationException(
SR
.Format(
SR
.net_auth_context_expectation, _context.ProtectionLevel.ToString(), _expectedProtectionLevel.ToString())),
840
new InvalidCredentialException(IsServer ?
SR
.net_auth_bad_client_creds :
SR
.net_auth_bad_client_creds_or_target_mismatch, win32Exception),
841
_ => new AuthenticationException(
SR
.net_auth_SSPI, win32Exception)
874
throw new AuthenticationException(
SR
.net_auth_eof);
887
throw new AuthenticationException(
SR
.net_auth_alert);
905
throw new AuthenticationException(
SR
.Format(
SR
.net_io_header_id, nameof(FrameHeader.MessageId), _framer.ReadHeader.MessageId, FrameHeader.HandshakeId));
913
throw new AuthenticationException(
SR
.Format(
SR
.net_io_header_id, nameof(FrameHeader.MessageId), _framer.ReadHeader.MessageId, FrameHeader.HandshakeDoneId));
942
(int)SecurityStatusPalErrorCode.LogonDenied => new InvalidCredentialException(
SR
.net_auth_bad_client_creds, e),
943
(int)Interop.SECURITY_STATUS.LogonDenied => new InvalidCredentialException(
SR
.net_auth_bad_client_creds, e),
944
ERROR_TRUST_FAILURE => new AuthenticationException(
SR
.net_auth_context_expectation_remote, e),
945
_ => new AuthenticationException(
SR
.net_auth_alert, e)
System\Net\Security\SslApplicationProtocol.cs (1)
34
throw new ArgumentException(
SR
.net_ssl_app_protocol_invalid, nameof(protocol));
System\Net\Security\SslAuthenticationOptions.cs (12)
47
throw new InvalidOperationException(
SR
.Format(
SR
.net_conflicting_options, nameof(RemoteCertificateValidationCallback)));
57
throw new InvalidOperationException(
SR
.Format(
SR
.net_conflicting_options, nameof(LocalCertificateSelectionCallback)));
79
throw new PlatformNotSupportedException(
SR
.net_ssl_allow_rsa_padding_not_supported);
110
throw new NotSupportedException(
SR
.net_ssl_io_no_server_cert);
118
throw new InvalidOperationException(
SR
.Format(
SR
.net_conflicting_options, nameof(ServerCertificateSelectionCallback)));
129
throw new InvalidOperationException(
SR
.Format(
SR
.net_conflicting_options, nameof(RemoteCertificateValidationCallback)));
149
throw new PlatformNotSupportedException(
SR
.net_ssl_allow_rsa_padding_not_supported);
181
throw new AuthenticationException(
SR
.net_ssl_io_no_server_cert);
System\Net\Security\SslCertificateTrust.cs (2)
26
throw new PlatformNotSupportedException(
SR
.net_ssl_trust_handshake);
50
throw new PlatformNotSupportedException(
SR
.net_ssl_trust_handshake);
System\Net\Security\SslClientAuthenticationOptions.cs (4)
57
throw new ArgumentException(
SR
.Format(
SR
.net_invalid_enum, nameof(X509RevocationMode)), nameof(value));
72
throw new ArgumentException(
SR
.Format(
SR
.net_invalid_enum, nameof(EncryptionPolicy)), nameof(value));
System\Net\Security\SslConnectionInfo.Linux.cs (1)
42
throw Interop.OpenSsl.CreateSslException(
SR
.net_ssl_get_connection_info_failed);
System\Net\Security\SslServerAuthenticationOptions.cs (4)
59
throw new ArgumentException(
SR
.Format(
SR
.net_invalid_enum, nameof(X509RevocationMode)), nameof(value));
74
throw new ArgumentException(
SR
.Format(
SR
.net_invalid_enum, nameof(EncryptionPolicy)), nameof(value));
System\Net\Security\SslStream.cs (9)
211
throw new ArgumentException(
SR
.Format(
SR
.net_invalid_enum, "EncryptionPolicy"), nameof(encryptionPolicy));
684
set => throw new NotSupportedException(
SR
.net_noseek);
689
public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(
SR
.net_noseek);
703
throw new InvalidOperationException(
SR
.net_ssl_certificate_exist);
753
throw new NotSupportedException(
SR
.Format(
SR
.net_io_invalidnestedcall, "read"));
965
throw new InvalidOperationException(
SR
.net_ssl_io_already_shutdown);
972
throw new InvalidOperationException(
SR
.net_auth_noauth);
System\Net\Security\SslStream.IO.cs (34)
180
throw new InvalidOperationException(
SR
.Format(
SR
.net_io_invalidnestedcall, "authenticate"));
186
throw new NotSupportedException(
SR
.Format(
SR
.net_io_invalidnestedcall, "read"));
193
throw new NotSupportedException(
SR
.Format(
SR
.net_io_invalidnestedcall, "write"));
202
throw new InvalidOperationException(
SR
.net_ssl_renegotiate_buffer);
276
throw new InvalidOperationException(
SR
.Format(
SR
.net_io_invalidnestedcall, "authenticate"));
347
throw new AuthenticationException(
SR
.net_auth_SSPI, token.GetException());
397
throw new AuthenticationException(
SR
.Format(
SR
.net_auth_tls_alert, _lastFrame.AlertDescription.ToString()), token.GetException());
408
throw new AuthenticationException(
SR
.net_auth_SSPI, token.GetException());
455
throw new IOException(
SR
.net_io_eof);
527
throw new InvalidOperationException(
SR
.net_ssl_renegotiate_data);
544
throw new AuthenticationException(
SR
.net_ssl_io_frame);
570
throw new AuthenticationException(
SR
.net_frame_read_size);
697
return ExceptionDispatchInfo.SetCurrentStackTrace(new AuthenticationException(
SR
.net_ssl_io_cert_custom_validation, null));
702
return ExceptionDispatchInfo.SetCurrentStackTrace(new AuthenticationException(
SR
.Format(
SR
.net_ssl_io_cert_chain_validation, chainStatus), null));
707
return ExceptionDispatchInfo.SetCurrentStackTrace(new AuthenticationException(
SR
.Format(
SR
.net_ssl_io_cert_validation, sslPolicyErrors), null));
754
return ValueTask.FromException(ExceptionDispatchInfo.SetCurrentStackTrace(new IOException(
SR
.net_io_encrypt, SslStreamPal.GetException(token.Status))));
789
throw new IOException(
SR
.net_io_encrypt, SslStreamPal.GetException(token.Status));
861
throw new IOException(
SR
.net_io_eof);
891
throw new NotSupportedException(
SR
.Format(
SR
.net_io_invalidnestedcall, "read"));
965
throw new IOException(
SR
.net_ssl_io_renego);
976
throw new IOException(
SR
.net_io_decrypt, SslStreamPal.GetException(status));
1034
throw new IOException(
SR
.net_io_read, e);
1056
throw new NotSupportedException(
SR
.Format(
SR
.net_io_invalidnestedcall, "write"));
1082
throw new IOException(
SR
.net_io_write, e);
1115
throw new AuthenticationException(
SR
.net_frame_read_size);
System\Net\Security\SslStream.Protocol.cs (7)
668
throw new AuthenticationException(
SR
.net_ssl_io_no_server_cert);
684
throw new NotSupportedException(
SR
.net_ssl_io_no_server_cert);
703
throw new NotSupportedException(
SR
.net_ssl_io_no_server_cert);
713
throw new NotSupportedException(
SR
.net_ssl_io_no_server_cert);
1477
NetEventSource.Log.RemoteCertificateError(sender,
SR
.net_log_remote_cert_has_errors);
1480
NetEventSource.Log.RemoteCertificateError(sender,
SR
.net_log_remote_cert_not_available);
1485
NetEventSource.Log.RemoteCertificateError(sender,
SR
.net_log_remote_cert_name_mismatch);
System\Net\Security\SslStreamCertificateContext.cs (1)
44
throw new NotSupportedException(
SR
.net_ssl_io_no_server_cert);
System\Net\Security\SslStreamCertificateContext.Linux.cs (1)
109
throw new NotSupportedException(
SR
.net_ssl_io_no_server_cert);
System\Net\Security\SslStreamPal.Unix.cs (1)
140
throw Interop.OpenSsl.CreateSslException(
SR
.net_ssl_invalid_certificate);
System\Net\Security\TlsSession.cs (35)
339
SR
.Format(
SR
.net_tlssession_validation_not_pending, nameof(AcceptWithDefaultValidation)));
416
SR
.Format(
SR
.net_tlssession_validation_not_pending, nameof(SetRemoteCertificateValidationResult)));
466
_externalValidationFault = new AuthenticationException(
SR
.net_ssl_io_cert_validation);
480
_externalValidationFault = new AuthenticationException(
SR
.net_ssl_io_cert_validation);
632
throw new InvalidOperationException(
SR
.net_tlssession_setcontext_server_only);
636
throw new ArgumentException(
SR
.net_tlssession_context_must_be_server, nameof(context));
640
throw new InvalidOperationException(
SR
.net_tlssession_server_options_already_supplied);
644
throw new InvalidOperationException(
SR
.net_tlssession_setcontext_needs_context_first);
705
throw new InvalidOperationException(
SR
.net_tlssession_setclientcert_client_only);
752
SR
.net_tlssession_validation_result_not_recorded);
867
throw new InvalidOperationException(
SR
.net_tlssession_handshake_already_complete);
902
throw new IOException(
SR
.net_io_decrypt);
1027
throw new AuthenticationException(
SR
.net_auth_SSPI, selStatus.Exception);
1064
Exception authExc = new AuthenticationException(
SR
.net_auth_SSPI, token.GetException());
1160
throw new InvalidOperationException(
SR
.net_tlssession_handshake_not_complete);
1190
throw new IOException(
SR
.net_io_encrypt, SslStreamPal.GetException(token.Status));
1230
throw new InvalidOperationException(
SR
.net_tlssession_handshake_not_complete);
1254
throw new IOException(
SR
.net_io_decrypt);
1289
SR
.Format(
SR
.net_tlssession_plaintext_buffer_too_small, needed, plaintext.Length));
1325
throw new IOException(
SR
.net_io_decrypt, SslStreamPal.GetException(status));
1371
SR
.Format(
SR
.net_tlssession_plaintext_buffer_too_small, produced, plaintext.Length));
1418
throw new InvalidOperationException(
SR
.net_tlssession_request_client_cert_server_only);
1423
throw new InvalidOperationException(
SR
.net_tlssession_handshake_not_complete);
1436
throw new AuthenticationException(
SR
.net_auth_SSPI, token.GetException());
1488
throw new IOException(
SR
.net_io_encrypt, SslStreamPal.GetException(status));
1589
throw new InvalidOperationException(
SR
.net_ssl_tlssession_context_not_set);
1648
throw new AuthenticationException(
SR
.net_ssl_io_no_server_cert);
1654
throw new AuthenticationException(
SR
.net_ssl_io_no_server_cert);
1905
throw new InvalidOperationException(
SR
.net_tlssession_not_socket_bound);
2063
throw new InvalidOperationException(
SR
.net_tlssession_handshake_not_complete);
2142
throw new InvalidOperationException(
SR
.net_tlssession_handshake_not_complete);
System\Net\Security\TlsSession.OpenSsl.cs (8)
135
throw Interop.OpenSsl.CreateSslException(
SR
.net_ssl_read_bio_failed_error);
150
throw new IOException(
SR
.net_ssl_read_bio_failed_error);
158
throw new IOException(
SR
.net_io_decrypt);
232
result = MapSslError(err, ret,
SR
.net_ssl_handshake_failed_error);
256
result = MapSslError(err, ret,
SR
.net_ssl_decrypt_failed);
280
result = MapSslError(err, ret,
SR
.net_ssl_encrypt_failed);
310
_ => throw new AuthenticationException(
SR
.net_auth_SSPI, CreateDiagnosticSslException(error, result, sslErrorTemplate)),
318
return new Interop.OpenSsl.SslException(
SR
.Format(sslErrorTemplate, error), detail);
System\Net\StreamFramer.cs (10)
44
throw new IOException(
SR
.Format(
SR
.net_io_readfailure,
SR
.net_io_connectionclosed));
50
throw new InvalidOperationException(
SR
.Format(
SR
.net_frame_size,
63
throw new IOException(
SR
.Format(
SR
.net_io_readfailure,
SR
.net_io_connectionclosed));
108
throw new ArgumentException(
SR
.Format(
SR
.net_frame_max_size, MaxMessageSize, value), nameof(PayloadSize));
System\Security\Authentication\ExtendedProtection\ExtendedProtectionPolicy.cs (3)
29
throw new ArgumentException(
SR
.security_ExtendedProtectionPolicy_UseDifferentConstructorForNever, nameof(policyEnforcement));
34
throw new ArgumentException(
SR
.security_ExtendedProtectionPolicy_NoEmptyServiceNameCollection, nameof(customServiceNames));
55
throw new ArgumentException(
SR
.security_ExtendedProtectionPolicy_UseDifferentConstructorForNever, nameof(policyEnforcement));