mirror of
https://github.com/floci-io/floci.git
synced 2026-11-28 16:11:48 -05:00
fix(elbv2): reconcile security settings on listener protocol changes (#7598)
* fix(elbv2): reconcile security settings on listener protocol changes Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): assign unique protocol transition test order Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(elbv2): align protocol transition CI fixtures Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
This commit is contained in:
1 parent
cbb2db82d1
commit
56eedbece5
8 files changed
+353
-31
No files matched your search
+6
-1
@@ -21,6 +21,8 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
@DisplayName("ELBv2 default listener certificates")
|
||||
class ElbV2DefaultCertificateTest {
|
||||
|
||||
private static final String SSL_POLICY = "ELBSecurityPolicy-2016-08";
|
||||
|
||||
@Test
|
||||
@DisplayName("HTTPS needs a default before listener creation or protocol replacement")
|
||||
void missingHttpsDefaultDoesNotPublishOrChangeAListener() {
|
||||
@@ -44,14 +46,17 @@ class ElbV2DefaultCertificateTest {
|
||||
assertThat(certificates(elb, https)).containsExactly(certificate);
|
||||
String http = createListener(elb, lbArn, "HTTP", 8080, null);
|
||||
InvalidConfigurationRequestException modification = assertThrows(InvalidConfigurationRequestException.class,
|
||||
() -> elb.modifyListener(b -> b.listenerArn(http).protocol("HTTPS").port(8443)));
|
||||
() -> elb.modifyListener(b -> b.listenerArn(http).protocol("HTTPS").port(8443)
|
||||
.sslPolicy(SSL_POLICY)));
|
||||
assertThat(modification.statusCode()).isEqualTo(400);
|
||||
assertThat(modification.getMessage()).contains("default certificate");
|
||||
Listener unchanged = elb.describeListeners(b -> b.listenerArns(http)).listeners().get(0);
|
||||
assertThat(unchanged.protocolAsString()).isEqualTo("HTTP");
|
||||
assertThat(unchanged.port()).isEqualTo(8080);
|
||||
assertThat(unchanged.certificates()).isEmpty();
|
||||
assertThat(unchanged.hasCertificates()).isFalse();
|
||||
elb.modifyListener(b -> b.listenerArn(http).protocol("HTTPS").port(8443)
|
||||
.sslPolicy(SSL_POLICY)
|
||||
.certificates(Certificate.builder().certificateArn(certificate).build()));
|
||||
assertThat(certificates(elb, http)).containsExactly(certificate);
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user