const std::string TargetCompID = "CNX";
const std::string Host = "TargetHost";
{
const std::string StreamSenderCompID = "str";
const std::string StreamSslCertificateAndPrivateKeyFile = "str.pem";
Session streamSession(StreamSenderCompID, TargetCompID, ProtocolVersion::FIX_42, ONIXS_FIXENGINE_NULLPTR);
streamSession.encryptionMethod(EncryptionMethod::SSL);
const int StreamPort = 442;
streamSession.sslCertificateFile(StreamSslCertificateAndPrivateKeyFile)
.sslPrivateKeyFile(StreamSslCertificateAndPrivateKeyFile)
.logonAsInitiator(Host, StreamPort, 30, true);
std::clog << "Stream session is established." << std::endl;
streamSession.logout();
}
{
const std::string TradingSenderCompID = "tr";
const std::string TradingSslCertificateAndPrivateKeyFile = "tr.pem";
Session tradingSession(TradingSenderCompID, TargetCompID, ProtocolVersion::FIX_42, ONIXS_FIXENGINE_NULLPTR);
tradingSession.encryptionMethod(EncryptionMethod::SSL);
const int TradingPort = 443;
tradingSession.sslCertificateFile(TradingSslCertificateAndPrivateKeyFile)
.sslPrivateKeyFile(TradingSslCertificateAndPrivateKeyFile)
.logonAsInitiator(Host, TradingPort, 30, true);
std::clog << "Trading session is established." << std::endl;
tradingSession.logout();
}