quickfixgo / quickfix

The Go FIX Protocol Library :rocket:
https://www.quickfixgo.org/
Other
723 stars 282 forks source link

Support TLS configuration as raw bytes #647

Open smulube opened 1 month ago

smulube commented 1 month ago

This change is intended to allow users to configure TLS settings in the form of raw byte slices. This is particularly useful for situations where the FIX application is running in a cloud environment (e.g. k8s) and session configuration is loaded from a database (rather than a static file). In this scenario it is much more convenient to be able to load TLS key pairs from the DB in the form of byte slices, than it is to have to ensure files with the correct names exist on some persistent volume such that the FIX app can load them from disk correctly.

To support this we changed the basic type stored within SessionSettings to be a byte slice which means we are able to still support the existing settings model, but also handle raw byte slices we can use for TLS setup. The existing API exposed by SessionSettings remains unchanged meaning users should not have to update their codee, but we have added a new SetRaw and RawSetting accessors to directly read/write byte slice values.