Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect server by quickfix using private key

Im connecting to server using FIX protocol 4.4. Previously i used username and password for authentication.

Below is my configuration file

[DEFAULT]
ConnectionType=initiator
HeartBtInt=30
ReconnectInterval=30
ResetOnLogout=Y
ResetOnDisconnect=Y
FileStorePath=/tmp/msgs/
FileLogPath=/tmp/msgs/log/
StartTime=00:00:
EndTime=00:00:00
UseDataDictionary=N
SocketConnectHost=193.~.~.~
SocketNodelay=Y
PersistMessages=N

[SESSION]
BeginString=FIX.4.4
SenderCompID=abcdefh
TargetCompID=abcdefh
SocketConnectPort=7000
SenderSubID=abcdefh
Password=abcdefh

Now have to connect without using SenderSubID & password, but using private key. The keys are given in a pem file. I am giving sample of the code below

Bag Attributes localKeyID: 12 23 34 45 56 AX SC DV FV FB 12 23 34 45 56 AX SC DV FV FB subject=/CN=abcdefgh issuer=/C=GB/ST=London/L=London/O=DB/OU=GM/CN=demo fix dev -----BEGIN CERTIFICATE----- abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890 -----END CERTIFICATE----- Bag Attributes: subject=/C=GB/ST=London/L=London/O=DB/OU=GM/CN=demo fix dev issuer=/C=GB/ST=London/L=London/O=DB/OU=GM/CN=demo fix dev -----BEGIN CERTIFICATE----- abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890 -----END CERTIFICATE----- Bag Attributes localKeyID: 12 23 34 45 56 AX SC DV FV FB 12 23 34 45 56 AX SC DV FV FB Key Attributes: -----BEGIN RSA PRIVATE KEY----- abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890 -----END RSA PRIVATE KEY-----

I don't know how to proceed or what to do with this PEM file
I am new to java and FIX protocol

If anyone can explain the solution with java code, that would be very helpful

thanks

like image 635
DPK Avatar asked Sep 06 '25 03:09

DPK


1 Answers

in order to connect with a counterparty with a PEM key, you have to install and config a new software.

In our production environment, we use sTunnel (https://www.stunnel.org/index.html) , a free software for tunnel and encrypt messages over a SSL layer.

Please download this sotware and read the manual for the config settings.

like image 126
stexcec Avatar answered Sep 07 '25 20:09

stexcec