Just for brainstorming: My general feeling is that a lot of this code - the parsing of the TLS variant, the default settings - should be general for all kamailio modules using TLS. If we decide to deprecate a version of TLS or add a new version, it would be simpler to have it in one place, not spread out over the code base.
Core Kamailio now has two TLS stacks supported. I have no clue, but would it be possible to use those as an interface to get the same multi-stack support here.