Establishing a connection to DUKASCOPY using stunnel

在通过 FIX4.4 协议使用 stunnel 和 quickfix python 与我的经纪人 DUKASCOPY 建立连接时寻求帮助。

这是我的 stunnel 配置:

1
2
3
4
5
6
client = yes
cert = /etc/stunnel/stunnel. pem

[OKSERVER ]
accept = 9443
connect = demo-api. dukascopy. com: 10443

我的快速修复 cfg 文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[DEFAULT ]
ConnectionType =initiator
LogonTimeout = 30
ReconnectInterval = 30
ResetOnLogon =Y
FileLogPath =./Logs/

[SESSION ]
BeginString =FIX.4.4
SenderCompID =SENDER_ID # replaced with anonymous value for this post
TargetCompID =TARGET_ID # replaced with anonymous value for this post
StartTime = 00: 00: 00
EndTime = 00: 00: 00
HeartBtInt = 30
CheckLatency =N
MaxLatency = 240
SocketConnectPort = 10443
SocketConnectHost =demo-api. dukascopy. com
UseDataDictionary =Y
DataDictionary =/home/jaspal/qfsample/quickfix/spec/FIX44. xml
FileStorePath =./Sessions/

当我尝试登录时,我得到:

1
2
3
4
5
2018100222: 26: 23.972817000 : Created session
2018100222: 26: 23.978505000 : Connecting to demo-api. dukascopy. com on port 10443 (Source : 0 )
2018100222: 26: 24.023770000 : Initiated logon request
2018100222: 26: 24.065703000 : Socket Error: Connection reset by peer.
2018100222: 26: 24.065799000 : Disconnecting

我可以确认我正在监听传入端口:

1
2
~/qfsample/quickfix-python-sample$ netstat -an | grep 9443
    tcp         0       0 0.0.0.0: 9443            0.0.0.0:*               LISTEN

我还在路由器上配置了 9443 端口转发到客户端机器。

以下是我从应用程序收到的消息:

1
2
onCreate ( self =< __main__. Application ; proxy of <Swig Object of type ‘FIX::Application *’ at 0x7f87db719030 > >, sessionID =<quickfix. SessionID ; proxy of <Swig Object of type ‘FIX::SessionID *’ at 0x7f87db6674e0 > > )
toAdmin ( self =< __main__. Application ; proxy of <Swig Object of type ‘FIX::Application *’ at 0x7f87db719030 > >, sessionID =<quickfix. Message ; proxy of <Swig Object of type ‘FIX::Message *’ at 0x7f87db667e70 > >, message =<quickfix. SessionID ; proxy of <Swig Object of type ‘FIX::SessionID *’ at 0x7f87db667d20 > > )

非常欢迎您在此处找到问题的任何帮助!



相关讨论

  • 还可以考虑在 stunnel 中使用 verify checkHost CAfile 选项,以检查证书信任链返回到 CA …


好的。所以我想我要么从这个伟大的论坛获得一些帮助,要么自己解决这个问题是不可避免的!在这种情况下是后者!

这是我出错的地方:

当您使用 stunnel 创建隧道时,您必须将目标设置到本地计算机上您在 stunnel 配置中为”接受”创建的端口,而不是代理的地址。现在很明显!这是我的 cfg 文件现在的样子:

1
2
SocketConnectPort = 9443
SocketConnectHost =localhost



相关讨论

  • 感谢您发布您的答案。那么,我是否正确地说您将您的发起者指向 stunnel,然后在您的 stunnel 配置中使用 IP 和端口作为交易场所?
  • @p.luck:正确:FIX -> Stunnel -> 交易场所


感谢@Jaspal 发布您的 Q


声明:本站(华域联盟www.cnhackhy.com)所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。