[jira] [Work logged] (ARTEMIS-4245) Expose web SNI settings
[ https://issues.apache.org/jira/browse/ARTEMIS-4245?focusedWorklogId=860137=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-860137 ] ASF GitHub Bot logged work on ARTEMIS-4245: --- Author: ASF GitHub Bot Created on: 02/May/23 16:18 Start Date: 02/May/23 16:18 Worklog Time Spent: 10m Work Description: gemmellr merged PR #4441: URL: https://github.com/apache/activemq-artemis/pull/4441 Issue Time Tracking --- Worklog Id: (was: 860137) Time Spent: 1.5h (was: 1h 20m) > Expose web SNI settings > --- > > Key: ARTEMIS-4245 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4245 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 1.5h > Remaining Estimate: 0h > > Expose sniHostCheck and sniRequired settings in the web config. > {code:xml} > >http://localhost:8161; sniHostCheck="false" > sniRequired="false"> > ... > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4245) Expose web SNI settings
[ https://issues.apache.org/jira/browse/ARTEMIS-4245?focusedWorklogId=860134=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-860134 ] ASF GitHub Bot logged work on ARTEMIS-4245: --- Author: ASF GitHub Bot Created on: 02/May/23 16:12 Start Date: 02/May/23 16:12 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #4441: URL: https://github.com/apache/activemq-artemis/pull/4441#discussion_r1182763373 ## tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/web/WebServerDTOConfigTest.java: ## @@ -97,6 +97,8 @@ private void testSetWebBindingProperties(WebServerDTO webServer, String bindingN properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".excludedCipherSuites", "test-excludedCipherSuites,3"); properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".keyStorePassword", "test-keyStorePassword"); properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".trustStorePassword", "test-trustStorePassword"); + properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".sniHostCheck", "true"); + properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".sniRequired", "true"); Review Comment: oops, for some reason I thought it was asserting the final value on WebServerComponent, not the DTO. Issue Time Tracking --- Worklog Id: (was: 860134) Time Spent: 1h 20m (was: 1h 10m) > Expose web SNI settings > --- > > Key: ARTEMIS-4245 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4245 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 1h 20m > Remaining Estimate: 0h > > Expose sniHostCheck and sniRequired settings in the web config. > {code:xml} > >http://localhost:8161; sniHostCheck="false" > sniRequired="false"> > ... > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4245) Expose web SNI settings
[ https://issues.apache.org/jira/browse/ARTEMIS-4245?focusedWorklogId=860103=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-860103 ] ASF GitHub Bot logged work on ARTEMIS-4245: --- Author: ASF GitHub Bot Created on: 02/May/23 13:46 Start Date: 02/May/23 13:46 Worklog Time Spent: 10m Work Description: brusdev commented on code in PR #4441: URL: https://github.com/apache/activemq-artemis/pull/4441#discussion_r1182573038 ## tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/web/WebServerDTOConfigTest.java: ## @@ -97,6 +97,8 @@ private void testSetWebBindingProperties(WebServerDTO webServer, String bindingN properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".excludedCipherSuites", "test-excludedCipherSuites,3"); properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".keyStorePassword", "test-keyStorePassword"); properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".trustStorePassword", "test-trustStorePassword"); + properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".sniHostCheck", "true"); + properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".sniRequired", "true"); Review Comment: BindingDTO default values for `sniHostCheck` and `sniRequired` are `null` but using WebServerComponent non-default value should to avoid confusion. Issue Time Tracking --- Worklog Id: (was: 860103) Time Spent: 1h 10m (was: 1h) > Expose web SNI settings > --- > > Key: ARTEMIS-4245 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4245 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 1h 10m > Remaining Estimate: 0h > > Expose sniHostCheck and sniRequired settings in the web config. > {code:xml} > >http://localhost:8161; sniHostCheck="false" > sniRequired="false"> > ... > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4245) Expose web SNI settings
[ https://issues.apache.org/jira/browse/ARTEMIS-4245?focusedWorklogId=860051=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-860051 ] ASF GitHub Bot logged work on ARTEMIS-4245: --- Author: ASF GitHub Bot Created on: 02/May/23 11:49 Start Date: 02/May/23 11:49 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #4441: URL: https://github.com/apache/activemq-artemis/pull/4441#discussion_r1182438994 ## artemis-web/src/main/java/org/apache/activemq/artemis/component/WebServerComponent.java: ## @@ -245,7 +245,10 @@ private ServerConnector createServerConnector(HttpConfiguration httpConfiguratio SslConnectionFactory sslConnectionFactory = new SslConnectionFactory(sslFactory, "HTTP/1.1"); - httpConfiguration.addCustomizer(new SecureRequestCustomizer()); + SecureRequestCustomizer secureRequestCustomizer = new SecureRequestCustomizer(); + secureRequestCustomizer.setSniHostCheck(binding.getSniHostCheck() != null ? binding.getSniHostCheck() : true); + secureRequestCustomizer.setSniRequired(binding.getSniRequired() != null ? binding.getSniRequired() : false); Review Comment: Perhaps constants for the defaults? ## tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/web/WebServerDTOConfigTest.java: ## @@ -97,6 +97,8 @@ private void testSetWebBindingProperties(WebServerDTO webServer, String bindingN properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".excludedCipherSuites", "test-excludedCipherSuites,3"); properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".keyStorePassword", "test-keyStorePassword"); properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".trustStorePassword", "test-trustStorePassword"); + properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".sniHostCheck", "true"); + properties.put(ActiveMQDefaultConfiguration.getDefaultSystemWebPropertyPrefix() + "bindings." + bindingName + ".sniRequired", "true"); Review Comment: These are both being set true...meaning one is being set to its already-expected default and the other isnt. Perhaps have both set the non-default value? Issue Time Tracking --- Worklog Id: (was: 860051) Time Spent: 1h (was: 50m) > Expose web SNI settings > --- > > Key: ARTEMIS-4245 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4245 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 1h > Remaining Estimate: 0h > > Expose sniHostCheck and sniRequired settings in the web config. > {code:xml} > >http://localhost:8161; sniHostCheck="false" > sniRequired="false"> > ... > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4245) Expose web SNI settings
[ https://issues.apache.org/jira/browse/ARTEMIS-4245?focusedWorklogId=859466=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-859466 ] ASF GitHub Bot logged work on ARTEMIS-4245: --- Author: ASF GitHub Bot Created on: 27/Apr/23 18:29 Start Date: 27/Apr/23 18:29 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #4441: URL: https://github.com/apache/activemq-artemis/pull/4441#discussion_r1179543812 ## artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java: ## @@ -283,6 +298,40 @@ public void simpleSecureServer() throws Exception { Assert.assertFalse(webServerComponent.isStarted()); } + + @Test + public void testSimpleSecureServerWithSniHostCheckEnabled() throws Exception { + testSimpleSecureServerWithSniHostCheck(true); + } + + @Test + public void testSimpleSecureServerWithSniHostCheckDisabled() throws Exception { + testSimpleSecureServerWithSniHostCheck(false); + } Review Comment: We could do that instead yes. Issue Time Tracking --- Worklog Id: (was: 859466) Time Spent: 50m (was: 40m) > Expose web SNI settings > --- > > Key: ARTEMIS-4245 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4245 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 50m > Remaining Estimate: 0h > > Expose sniHostCheck and sniRequired settings in the web config. > {code:xml} > >http://localhost:8161; sniHostCheck="false" > sniRequired="false"> > ... > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4245) Expose web SNI settings
[ https://issues.apache.org/jira/browse/ARTEMIS-4245?focusedWorklogId=859464=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-859464 ] ASF GitHub Bot logged work on ARTEMIS-4245: --- Author: ASF GitHub Bot Created on: 27/Apr/23 18:24 Start Date: 27/Apr/23 18:24 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #4441: URL: https://github.com/apache/activemq-artemis/pull/4441#discussion_r1179539330 ## artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java: ## @@ -215,11 +221,11 @@ public void testComponentStopStartBehavior() throws Exception { Assert.assertFalse(webServerComponent.isStarted()); } - @Test - public void simpleSecureServer() throws Exception { + private WebServerComponent startSimpleSecureServer(String keyStorePath, String keyStorePassword, Boolean sniHostCheck) throws Exception { BindingDTO bindingDTO = new BindingDTO(); bindingDTO.uri = "https://localhost:0;; bindingDTO.keyStorePath = "./src/test/resources/server.keystore"; + bindingDTO.setSniHostCheck(sniHostCheck); Review Comment: Sure, but the comment was just about 'getting the default behaviour' rather than explicitly setting the null (whichone testdoes), and instead relying on the bonafiide default behaviour so it could be verified to match what we expect. Issue Time Tracking --- Worklog Id: (was: 859464) Time Spent: 40m (was: 0.5h) > Expose web SNI settings > --- > > Key: ARTEMIS-4245 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4245 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 40m > Remaining Estimate: 0h > > Expose sniHostCheck and sniRequired settings in the web config. > {code:xml} > >http://localhost:8161; sniHostCheck="false" > sniRequired="false"> > ... > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4245) Expose web SNI settings
[ https://issues.apache.org/jira/browse/ARTEMIS-4245?focusedWorklogId=859430=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-859430 ] ASF GitHub Bot logged work on ARTEMIS-4245: --- Author: ASF GitHub Bot Created on: 27/Apr/23 15:54 Start Date: 27/Apr/23 15:54 Worklog Time Spent: 10m Work Description: brusdev commented on code in PR #4441: URL: https://github.com/apache/activemq-artemis/pull/4441#discussion_r1179376675 ## artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java: ## @@ -215,11 +221,11 @@ public void testComponentStopStartBehavior() throws Exception { Assert.assertFalse(webServerComponent.isStarted()); } - @Test - public void simpleSecureServer() throws Exception { + private WebServerComponent startSimpleSecureServer(String keyStorePath, String keyStorePassword, Boolean sniHostCheck) throws Exception { BindingDTO bindingDTO = new BindingDTO(); bindingDTO.uri = "https://localhost:0;; bindingDTO.keyStorePath = "./src/test/resources/server.keystore"; + bindingDTO.setSniHostCheck(sniHostCheck); Review Comment: If the test doesn't set bindingDTO.sniHostCheck the WebServerComponent behaviour depends on org.eclipse.jetty.server.SecureRequestCustomizer._sniHostCheck default value and it already changed from 9.x to 10.x ## artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java: ## @@ -283,6 +298,40 @@ public void simpleSecureServer() throws Exception { Assert.assertFalse(webServerComponent.isStarted()); } + + @Test + public void testSimpleSecureServerWithSniHostCheckEnabled() throws Exception { + testSimpleSecureServerWithSniHostCheck(true); + } + + @Test + public void testSimpleSecureServerWithSniHostCheckDisabled() throws Exception { + testSimpleSecureServerWithSniHostCheck(false); + } Review Comment: Maybe we should enable sniHostCheck by default because org.eclipse.jetty.server.SecureRequestCustomizer._sniHostCheck default value already changed from 9.x to 10.x Issue Time Tracking --- Worklog Id: (was: 859430) Time Spent: 0.5h (was: 20m) > Expose web SNI settings > --- > > Key: ARTEMIS-4245 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4245 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 0.5h > Remaining Estimate: 0h > > Expose sniHostCheck and sniRequired settings in the web config. > {code:xml} > >http://localhost:8161; sniHostCheck="false" > sniRequired="false"> > ... > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4245) Expose web SNI settings
[ https://issues.apache.org/jira/browse/ARTEMIS-4245?focusedWorklogId=859372=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-859372 ] ASF GitHub Bot logged work on ARTEMIS-4245: --- Author: ASF GitHub Bot Created on: 27/Apr/23 10:11 Start Date: 27/Apr/23 10:11 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #4441: URL: https://github.com/apache/activemq-artemis/pull/4441#discussion_r1178936369 ## artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java: ## @@ -283,6 +298,40 @@ public void simpleSecureServer() throws Exception { Assert.assertFalse(webServerComponent.isStarted()); } + + @Test + public void testSimpleSecureServerWithSniHostCheckEnabled() throws Exception { + testSimpleSecureServerWithSniHostCheck(true); + } + + @Test + public void testSimpleSecureServerWithSniHostCheckDisabled() throws Exception { + testSimpleSecureServerWithSniHostCheck(false); + } Review Comment: Do we want to test the default behaviour is 'enabled' (i.e change the boolean to Boolean and pass null as well)? Currently nothing looks to be checking the default, since these 2 tests only verify it succeeds/fails using the IP address when the setting was _explicitly_ disabled or enabled. ## artemis-dto/src/main/java/org/apache/activemq/artemis/dto/BindingDTO.java: ## @@ -181,6 +187,22 @@ public void addApp(AppDTO app) { apps.add(app); } + public Boolean getSniHostCheck() { + return sniHostCheck; + } + + public void setSniHostCheck(Boolean sniHostCheck) { + this.sniHostCheck = sniHostCheck; + } + + public Boolean getSniRequired() { + return sniRequired; + } + + public void setSniRequired(Boolean sniRequired) { + this.sniRequired = sniRequired; + } + Review Comment: org.apache.activemq.artemis.dto.test.BindingDTOTest.testDefault() should be updated to check these are null by default since the new default behaviour depends on it. ## artemis-web/src/test/java/org/apache/activemq/cli/test/WebServerComponentTest.java: ## @@ -215,11 +221,11 @@ public void testComponentStopStartBehavior() throws Exception { Assert.assertFalse(webServerComponent.isStarted()); } - @Test - public void simpleSecureServer() throws Exception { + private WebServerComponent startSimpleSecureServer(String keyStorePath, String keyStorePassword, Boolean sniHostCheck) throws Exception { BindingDTO bindingDTO = new BindingDTO(); bindingDTO.uri = "https://localhost:0;; bindingDTO.keyStorePath = "./src/test/resources/server.keystore"; + bindingDTO.setSniHostCheck(sniHostCheck); Review Comment: might be nice to only set it if non-null? Issue Time Tracking --- Worklog Id: (was: 859372) Time Spent: 20m (was: 10m) > Expose web SNI settings > --- > > Key: ARTEMIS-4245 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4245 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > Expose sniHostCheck and sniRequired settings in the web config. > {code:xml} > >http://localhost:8161; sniHostCheck="false" > sniRequired="false"> > ... > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4245) Expose web SNI settings
[ https://issues.apache.org/jira/browse/ARTEMIS-4245?focusedWorklogId=858016=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-858016 ] ASF GitHub Bot logged work on ARTEMIS-4245: --- Author: ASF GitHub Bot Created on: 19/Apr/23 17:10 Start Date: 19/Apr/23 17:10 Worklog Time Spent: 10m Work Description: brusdev opened a new pull request, #4441: URL: https://github.com/apache/activemq-artemis/pull/4441 This PR depends on #4440 Issue Time Tracking --- Worklog Id: (was: 858016) Remaining Estimate: 0h Time Spent: 10m > Expose web SNI settings > --- > > Key: ARTEMIS-4245 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4245 > Project: ActiveMQ Artemis > Issue Type: Improvement >Reporter: Domenico Francesco Bruscino >Assignee: Domenico Francesco Bruscino >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > Expose sniHostCheck and sniRequired settings in the web config. > {code:xml} > >http://localhost:8161; sniHostCheck="false" > sniRequired="false"> > ... > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)