Always use fallback mechanism in detector connection factory
@@ -108,7 +108,7 @@ public class ConnectorFactory {
if (proxyProtocolConfig.enabled()) {
ProxyConnectionFactory proxyProtocolFactory = newProxyProtocolConnectionFactory(sslFactory);
if (proxyProtocolConfig.mixedMode()) {
- DetectorConnectionFactory detectorFactory = newDetectorConnectionFactory(sslFactory, proxyProtocolFactory);
+ DetectorConnectionFactory detectorFactory = newDetectorConnectionFactory(sslFactory);
return List.of(detectorFactory, proxyProtocolFactory, sslFactory, alpnFactory, http1Factory, http2Factory);
} else {
return List.of(proxyProtocolFactory, sslFactory, alpnFactory, http1Factory, http2Factory);
@@ -121,7 +121,7 @@ public class ConnectorFactory {
if (proxyProtocolConfig.enabled()) {
ProxyConnectionFactory proxyProtocolFactory = newProxyProtocolConnectionFactory(sslFactory);
if (proxyProtocolConfig.mixedMode()) {
- DetectorConnectionFactory detectorFactory = newDetectorConnectionFactory(sslFactory, proxyProtocolFactory);
+ DetectorConnectionFactory detectorFactory = newDetectorConnectionFactory(sslFactory);
return List.of(detectorFactory, proxyProtocolFactory, sslFactory, http1Factory);
} else {
return List.of(proxyProtocolFactory, sslFactory, http1Factory);
@@ -136,8 +136,6 @@ public class ConnectorFactory {
// No support for proxy-protocol/http2 when using HTTP with TLS mixed mode
HttpConnectionFactory httpFactory = newHttp1ConnectionFactory();
SslConnectionFactory sslFactory = newSslConnectionFactory(metric, httpFactory);
- // Detector connection factory with single alternative will fallback to next protocol in list (httpFactory in this case)
- // Cannot specify HttpConnectionFactory as alternative it does not implement ConnectionFactory.Detecting
DetectorConnectionFactory detectorFactory = newDetectorConnectionFactory(sslFactory);
return List.of(detectorFactory, httpFactory, sslFactory);
}
@@ -181,6 +179,7 @@ public class ConnectorFactory {
}
private DetectorConnectionFactory newDetectorConnectionFactory(ConnectionFactory.Detecting... alternatives) {
+ // Note: Detector connection factory with single alternative will fallback to next protocol in connection factory list
return new DetectorConnectionFactory(alternatives);
}
