PortAssigner replaces app/admin connectors #427
Replies: 2 comments 1 reply
-
There is a potential problem with using the existing server configuration defined in YAML configuration. If we want to assign secure dynamic ports, but the server configuration in the YAML is defined with non-secure ports, then simply updating the port numbers would not work, since the resulting connectors would be non-secure HTTP. One way of dealing with this would be to validate the connector types are secure and throw an exception if not. This is not ideal, but at least it guarantees correct behavior. So, someone could define a server configuration like: server:
applicationConnectors:
- type: https
keyStorePath: example.keystore
keyStorePassword: example
validateCerts: false
adminConnectors:
- type: https
keyStorePath: example.keystore
keyStorePassword: example
validateCerts: false Then, we would simply accept all the static configuration and change only the port numbers. But if someone used Another issue is that if the Another way to solve some of the above problems is to say that, if |
Beta Was this translation helpful? Give feedback.
-
Another slight variation on those discussed in my earlier comments is to overlay all non-null properties from the So, assuming secure ports, when the YAML has an explicit configuration and the connectors are But if there is no explicit This needs some additional thinking and more details, but I think we can make it work to allow dynamic ports for both secure and non-secure ports, and overlaying TLS properties for secure ports. And when no explicit |
Beta Was this translation helpful? Give feedback.
-
PortAssigner
completely replaces the application and admin connectors when using secure dynamic ports. It would be better to allow for explicit configuration in YAML to set whatever properties are needed, but still assign secure dynamic ports and apply only the TLS configuration. For example, an application might want to change properties that come fromHttpConnectorFactory
such as theidleTimeout
or theoutputBufferSize
while still using dynamically chosen ports with TLS properties supplied by theTlsContextConfiguration
given toPortAssigner
at construction time.This is not a problem when assigning non-secure (i.e., HTTP) because we simply find the connectors (application and admin) and update the ports to the randomly chosen ones. So, an application using dynamic ports and HTTP can specify explicit configuration in its
config.yml
but still have the dynamic ports applied.This has never been a problem in our services only because when we've used secure dynamic ports, we've not needed to change the default values that come from
HttpConnectorFactory
, and we aren't using any of the properties that we don't override (e.g., we override many properties using theTlsContextConfiguration
provided to thePortAssigner
but don't change the default values for other things likecrlPath
).So, when using secure dynamic ports, the
PortAssigner
should allow explicit configuration inconfig.yml
except for the ports and the TLS properties. All other properties should be overridable inconfig.yml
.There is an
@implNote
onPortAssigner#assignDynamicPorts
that mentions this limitation. If this change is implemented that note should be removed.Beta Was this translation helpful? Give feedback.
All reactions