config: support TLS options in iproto.listen
This patch changes format of iproto.listen and introduces support for TLS options in the iproto.listen config option. Part of #8862 @TarantoolBot document Title: new format of the `iproto.*` config options. The config options `iproto.listen`, `iproto.advertise.peer` and `iproto.advertise.sharding` now have a new format. The `iproto.listen` config option now has the following format: ``` iproto: listen: - uri: <string> params: transport: <'plain' or 'ssl'> ssl_ca_file: <string> ssl_cert_file: <string> ssl_ciphers: <string> ssl_key_file: <string> ssl_password: <string> ssl_password_file: <string> - uri: <string> params: transport: <'plain' or 'ssl'> ssl_ca_file: <string> ssl_cert_file: <string> ssl_ciphers: <string> ssl_key_file: <string> ssl_password: <string> ssl_password_file: <string> ... ``` The `iproto.listen` config option is now an array, and its elements are `records` that can only have a required `uri` field and an optional `params` field. The `uri` field is of type `string` and must be a single valid URI. The URI cannot contain parameters, login and password. The `params` field is a `record` with the fields `transport`, `ssl_ca_file`, `ssl_cert_file`, `ssl_ciphers`, `ssl_key_file`, `ssl_password`, `ssl_password_file`. The `transport` field can have one of two values: `plain` or `ssl`, the default is `plain`. If `transport` is set to `plain`, no additional fields are required. When `transport` is set to `ssl`, the fields `ssl_key_file` and `ssl_cert_file` are required, and the remaining fields are optional. The `iproto.advertise.peer` and `iproto.advertise.sharding` now have the following format: ``` iproto: advertise: <'peer' or 'sharding'>: uri: <string> login: <string> password: <string> params: transport: <'plain' or 'ssl'> ssl_ca_file: <string> ssl_cert_file: <string> ssl_ciphers: <string> ssl_key_file: <string> ssl_password: <string> ssl_password_file: <string> ``` The `iproto.advertise.peer` and `iproto.advertise.sharding` are now `records`. All of their fields are optional, however, if the `params` field can be set only if the `uri` field is set and the `password` field can be set only if the `login` field is set. The `uri` field is of type `string` and must be a single valid URI. The URI cannot contain parameters, login and password. If the `uri` and `params` fields are missing, the appropriate `iproto.listen` element is selected. An element is eligible if, after parsing its `url` field using `require('uri').parse()`, the `ipv4` result field is not equal to `'0.0.0.0'`, the `ipv6` result field is not equal to `'::'`, and the `service` result field is not equal to `'0'`. The `login` and `password` fields are of type `string`. For description of the `params` field see description of `iproto.listen`.
Showing
- changelogs/unreleased/gh-8862-rework-iproto-listen.md 3 additions, 0 deletionschangelogs/unreleased/gh-8862-rework-iproto-listen.md
- doc/examples/config/replicaset.yaml 2 additions, 1 deletiondoc/examples/config/replicaset.yaml
- doc/examples/config/replicaset_election_failover.yaml 2 additions, 1 deletiondoc/examples/config/replicaset_election_failover.yaml
- doc/examples/config/replicaset_manual_failover.yaml 2 additions, 1 deletiondoc/examples/config/replicaset_manual_failover.yaml
- doc/examples/config/sharding.yaml 2 additions, 1 deletiondoc/examples/config/sharding.yaml
- doc/examples/config/single.yaml 2 additions, 1 deletiondoc/examples/config/single.yaml
- doc/examples/config/upgrade.yaml 2 additions, 1 deletiondoc/examples/config/upgrade.yaml
- src/box/lua/config/applier/box_cfg.lua 7 additions, 0 deletionssrc/box/lua/config/applier/box_cfg.lua
- src/box/lua/config/instance_config.lua 69 additions, 24 deletionssrc/box/lua/config/instance_config.lua
- test/config-luatest/basic_test.lua 81 additions, 25 deletionstest/config-luatest/basic_test.lua
- test/config-luatest/cbuilder.lua 3 additions, 1 deletiontest/config-luatest/cbuilder.lua
- test/config-luatest/cluster_config_schema_test.lua 2 additions, 3 deletionstest/config-luatest/cluster_config_schema_test.lua
- test/config-luatest/config_test.lua 402 additions, 17 deletionstest/config-luatest/config_test.lua
- test/config-luatest/credentials_applier_test.lua 2 additions, 2 deletionstest/config-luatest/credentials_applier_test.lua
- test/config-luatest/helpers.lua 1 addition, 1 deletiontest/config-luatest/helpers.lua
- test/config-luatest/instance_config_schema_test.lua 70 additions, 52 deletionstest/config-luatest/instance_config_schema_test.lua
- test/config-luatest/mkdir_test.lua 4 additions, 2 deletionstest/config-luatest/mkdir_test.lua
- test/config-luatest/names_upgrade_test.lua 1 addition, 1 deletiontest/config-luatest/names_upgrade_test.lua
- test/config-luatest/reload_test.lua 4 additions, 2 deletionstest/config-luatest/reload_test.lua
- test/config-luatest/set_names_reload_test.lua 1 addition, 1 deletiontest/config-luatest/set_names_reload_test.lua
Loading
Please register or sign in to comment