简体   繁体   English

从DMZ到Intranet的双通道WCF

[英]Duplex channel WCF from DMZ to Intranet

We are running an dual channel service inside the domain. 我们正在域内运行双通道服务。 We have a TCP binding on port 20120 and a HTTP binding on port 20121. 我们在端口20120上有一个TCP绑定,在端口20121上有一个HTTP绑定。

In the DMZ (web), we want to access this WCF service. 在DMZ(网络)中,我们要访问此WCF服务。 Firewall seems to be open from the web to the service. 防火墙似乎已从网络打开到服务。 Using telnet, i can access both ports and i am also able to browse the WSDL from a browser of web. 使用telnet,我可以同时访问两个端口,也可以从Web浏览器浏览WSDL。 now, when i try to do the connect to the service from the web application (it uses TcpBinding, and i cannot change it easly to HttpBinding without redeploying new binaries which is a painfull process), i get an exception. 现在,当我尝试从Web应用程序连接到服务时(它使用TcpBinding,并且如果不重新部署新的二进制文件就无法轻松地将其更改为HttpBinding,这是一个痛苦的过程),我遇到了一个异常。

System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9680000'.

System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.ServiceModel.Channels.ServiceChannelProxy.ExecuteMessage(Object target, IMethodCallMessage methodCall)
System.ServiceModel.Channels.ServiceChannelProxy.InvokeChannel(IMethodCallMessage methodCall)
System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout)
System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout) ...

Our test environment was all intranet, so no DMZ. 我们的测试环境全部是Intranet,因此没有DMZ。 there it all works fine. 在那里一切正常。

Service itself is running as a domain user, and the client service behaviour has its userPrincipal configured (like username@domain.ext). 服务本身以域用户身份运行,并且客户端服务行为已配置其userPrincipal(例如username@domain.ext)。 does this need access to the domain controller of domain.exe ? 这需要访问domain.exe的域控制器吗?

I also enabled WCF logging on the service side, but nothing happens there. 我还在服务端启用了WCF日志记录,但是在那里什么也没有发生。 all is quite, like nothing happended there. 一切都相当,就像那里什么都没发生。 Is there any other spot i missed to check why the connection drops. 我还有其他地方想念一下为什么连接断开了吗?

EDIT1: I wrote a little test program, that establishes the wcf connection and calls 2 methods. EDIT1:我编写了一个小测试程序,该程序建立了wcf连接并调用了2个方法。 This works fine from the same machine as the service and from the dmz web as well. 在与该服务相同的机器上以及从dmz网站上都可以正常工作。 binding settings are the same. 绑定设置相同。 (confirmed that). (确认)。 I run the test as a local user from a normal console on th dmz web machine. 我从dmz Web机上的普通控制台以本地用户身份运行测试。 any hints? 有什么提示吗?

well, we changed the security mode to none <security mode="None"/> and now the web has access. 好了,我们将安全模式更改为none <security mode="None"/> ,现在Web可以访问了。 i think the problem was, even though i used a local user when running my test programm, the vpn/rdp session i used to access from the domain to dmz doug a hole in the security and the i was able to connect to the wcf service. 我认为问题是,即使我在运行测试程序时使用了本地用户,我用来从域访问dmz的vpn / rdp会话也给安全性造成了漏洞,而且我能够连接到wcf服务。 the webside did not have that hole, so it failed. Web侧没有该孔,因此失败了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM