internal AmqpSecurity(AmqpTransportSecurity tsec) { if (tsec == null) { throw new ArgumentNullException("AmqpTransportSecurity"); } this.mode = AmqpSecurityMode.Transport; this.transportSecurity = tsec; }
protected override void OnApplyConfiguration(Binding binding) { if (binding == null) { throw new ArgumentNullException("binding"); } if (!(binding is AmqpBinding)) { throw new ArgumentException(string.Format("Invalid type for configuring an AMQP binding. Expected type: {0}. Type passed in: {1}.", typeof(AmqpBinding).AssemblyQualifiedName, binding.GetType().AssemblyQualifiedName)); } AmqpBinding amqpBinding = (AmqpBinding)binding; amqpBinding.BrokerHost = this.BrokerHost; amqpBinding.BrokerPort = this.BrokerPort; amqpBinding.TransferMode = this.TransferMode; amqpBinding.Shared = this.Shared; amqpBinding.PrefetchLimit = this.PrefetchLimit; AmqpSecurityMode mode = AmqpSecurityMode.None; if (this.Security != null) { mode = this.Security.Mode; } if (mode == AmqpSecurityMode.None) { if (amqpBinding.SecurityEnabled) { amqpBinding.Security.Mode = AmqpSecurityMode.None; } } else { amqpBinding.Security.Mode = AmqpSecurityMode.Transport; amqpBinding.Security.Transport.CredentialType = this.Security.Transport.CredentialType; amqpBinding.Security.Transport.IgnoreEndpointClientCredentials = this.Security.Transport.IgnoreEndpointCredentials; amqpBinding.Security.Transport.UseSSL = this.Security.Transport.UseSSL; if (this.Security.Transport.DefaultCredential != null) { amqpBinding.Security.Transport.DefaultCredential = new AmqpCredential( this.Security.Transport.DefaultCredential.UserName, this.Security.Transport.DefaultCredential.Password); } else { amqpBinding.Security.Transport.DefaultCredential = null; } } }
internal AmqpChannelProperties() { this.brokerHost = AmqpDefaults.BrokerHost; this.brokerPort = AmqpDefaults.BrokerPort; this.transferMode = AmqpDefaults.TransferMode; this.defaultMessageProperties = null; this.amqpSecurityMode = AmqpSecurityMode.None; this.amqpTransportSecurity = null; this.amqpCredential = null; this.maxBufferPoolSize = AmqpDefaults.MaxBufferPoolSize; this.maxReceivedMessageSize = AmqpDefaults.MaxReceivedMessageSize; }
protected override void OnOpen(TimeSpan timeout) { // check and freeze security properties now AmqpSecurityMode mode = AmqpSecurityMode.None; if (this.bindingElement.BindingSecurity != null) { mode = bindingElement.BindingSecurity.Mode; } this.channelProperties.AmqpSecurityMode = mode; if (mode == AmqpSecurityMode.None) { return; } AmqpChannelHelpers.FindAuthenticationCredentials(this.channelProperties, this.bindingContext); }
internal AmqpSecurity() { this.mode = AmqpSecurityMode.None; }