Skip to content

Socket Error: Connection reset by peer. #4

Open

Description

@pavel-tashev

Hi,

When I try to make a connection in the log directory I get this message:

20190814-13:18:18.915796000 : Initiated logon request
20190814-13:18:18.933123000 : Socket Error: Connection reset by peer.
20190814-13:18:18.933173000 : Disconnecting

I have no idea but I can't connect to the remote server. According to them, I do not execute requests to their server. I followed all instruction for the installation.

To install quickfix I used this command:

pip install quickfix

Do I have to make any other configurations/settings? I suspect that there is an issue with the ports or maybe the installation of quickfix is not correct. Any suggestions?

Activity

  1. pavel-tashev commented on Aug 15, 2019

    @pavel-tashev
    Author

    I came closer to the issue and I think that in the config file when I add this:

    SocketUseSSL=Y

    It's not enough for the SSL communication to be established. I have to generate self-signed certificate which I did but still doesn't work. Any suggestions?

  2. fvmt commented on Aug 15, 2019

    @fvmt
    Owner

    Hmm After 5 years I've just tried to execute all this and it still works like a charm :D Have to notice that I've built quickfix manually from their github account. Give me some more time to investigate, but meanwhile make sure that when you are trying to connect with client, your server is already up and listening for connections. Привет!

  3. pavel-tashev commented on Aug 15, 2019

    @pavel-tashev
    Author

    Привет ;)

    Actually what I did yesterday is to connect to two trading platforms. Let's label them (1) and (2). (1) requires SSL (+TLSv1) and (2) does not.

    When I try to connect to (2) it works like a charm but when I try to connect to (1) I get the error "Socket Error: Connection reset by peer." which according to Quickfix happens when receiving messages over Socket fails (check this link: https://github.com/quickfix/quickfix/blob/dab6d9f937e3bc700a2e8be681936b0069857609/src/C%2B%2B/Exceptions.h, row 281).

    Taking into account that (1) requires but (2) does not require SSL tunnel, I presume that the issue is caused by a missing self-signed certificate.

    This is why the main question here is how with the help of "quickfix-python-sample" to do that? What I did is to generate a self-signed certificate (Ubuntu 18.04) and add the following lines of code in the *.cfg file.

    SocketUseSSL=Y
    SSLProtocol=+TLSv1
    SocketKeyStore=/PATH-TO-CERTIFICATE/CERT.pem
    SocketKeyStorePassword=PASSWORD
    

    and this one as well:

    SocketUseSSL=Y
    SSLProtocol=+TLSv1
    ServerCertificateFile=/PATH-TO-CERTIFICATE/CERT.crt
    ServerCertificateKeyFile=/PATH-TO-CERTIFICATE/CERT.key
    SocketKeyStorePassword=PASSWORD
    

    Unfortunately it didn't work.

    Questions:

    • Have you used "quickfix-python-sample" to connect to trades requiring SSL connection?
    • Do I have to make additional configurations of the Ubuntu server in order to make that working?
  4. pavel-tashev commented on Aug 28, 2019

    @pavel-tashev
    Author

    Quick update, I used Quickfix/J with enabled SSL connection and I was able to connect to my client successfully (the trading platform). I presume that the issue we have here is that python does not establish socket connection with a self-signed certificate. The question is: How to establish a self-signed SSL connection?

    Any progress on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions