WCF를 사용하여 MSMQ (net.msmq 프로토콜)를 통해 메시지를 보냅니다. BizTalk Server는 메시지를 받고 처리합니다. 그러나 SVCLOG를 살펴보면 MsmqProtectionLevel을 Sign으로 설정하면 메시지가 암호화 된 것을 볼 수 있습니다.서명이 지정되면 WCF 메시지 (net.msmq) 암호화
이 동작을 본 사람이 있습니까? 암호화를 중지 할 수 있습니까? 일부 메시지가 1MB 이상이고 암호화로 인해 실제 속도가 느려집니다.
미리 감사드립니다.
ChannelFactory<OnRampEntry> Factory
{
get
{
if (factory == null)
{
lock (this)
{
if (factory == null)
{
var uri = ResolveQueueName(new Uri(Url));
var identity = EndpointIdentity.CreateDnsIdentity(BizTalkIdentity);
var binding = new NetMsmqBinding(NetMsmqSecurityMode.Both)
{
DeadLetterQueue = DeadLetterQueue.System,
ExactlyOnce = true
};
binding.Security.Message.ClientCredentialType = MessageCredentialType.Certificate;
binding.Security.Transport.MsmqProtectionLevel = System.Net.Security.ProtectionLevel.Sign;
binding.Security.Transport.MsmqAuthenticationMode = MsmqAuthenticationMode.WindowsDomain;
binding.Security.Transport.MsmqSecureHashAlgorithm = MsmqSecureHashAlgorithm.Sha1;
factory = new ChannelFactory<OnRampEntry>(binding, new EndpointAddress(uri, identity, (AddressHeaderCollection) null));
factory.Endpoint.Behaviors.Add(new LogonCertificateBehavior());
factory.Credentials.ServiceCertificate.SetDefaultCertificate(StoreLocation.LocalMachine, StoreName.TrustedPeople, X509FindType.FindBySubjectName, BizTalkIdentity);
factory.Open();
}
}
}
return factory;
}
}
/// <summary>
/// MSMQ does not allow a DNS alias to be used in a queue name, e.g. "net.msmq://alias/private$/queue".
/// <b>ResolveQueueName</b> will tranlsate an alias to its actual machine name.
/// </summary>
/// <param name="uri"></param>
/// <returns></returns>
Uri ResolveQueueName(Uri uri)
{
var hostName = uri.DnsSafeHost;
try
{
var hostEntry = Dns.GetHostEntry(hostName);
var resolved = new Uri(uri.ToString().Replace(hostName, hostEntry.HostName));
if (log.IsDebugEnabled)
log.Debug(string.Format("Resolved '{0}' to '{1}'.", uri, resolved));
return resolved;
}
catch (SocketException e)
{
if (e.SocketErrorCode == SocketError.HostNotFound)
return uri;
throw e;
}
}