mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(tls): add host.docker.internal to self-signed cert SANs (#1821)
Lambda containers reach Floci via host.docker.internal when Floci runs on the host instead of in a container, but the cert never included it as a SAN, failing TLS verification.
This commit is contained in:
1 parent
fe2008848f
commit
9b63b31530
4 files changed
+16
-8
No files matched your search
@@ -229,7 +229,7 @@ class TlsCertificateHostnameTest {
|
||||
List<String> sans = extractSansFromCertificate(cert);
|
||||
|
||||
Set<String> expectedSans = Set.of("localhost", "127.0.0.1", "0.0.0.0", "*.localhost",
|
||||
"localhost.floci.io", "*.localhost.floci.io");
|
||||
"localhost.floci.io", "*.localhost.floci.io", "host.docker.internal");
|
||||
Set<String> actualSans = new HashSet<>(sans);
|
||||
|
||||
assertEquals(expectedSans, actualSans,
|
||||
@@ -252,7 +252,7 @@ class TlsCertificateHostnameTest {
|
||||
List<String> sans = extractSansFromCertificate(cert);
|
||||
|
||||
Set<String> expectedSans = Set.of("localhost", "127.0.0.1", "0.0.0.0", "*.localhost",
|
||||
"localhost.floci.io", "*.localhost.floci.io");
|
||||
"localhost.floci.io", "*.localhost.floci.io", "host.docker.internal");
|
||||
Set<String> actualSans = new HashSet<>(sans);
|
||||
|
||||
assertEquals(expectedSans, actualSans,
|
||||
|
||||
+5
-2
@@ -158,9 +158,12 @@ class TlsConfigSourceCertificateGenerationTest {
|
||||
assertTrue(sans.contains("0.0.0.0"),
|
||||
"Certificate SANs should include default '0.0.0.0'");
|
||||
|
||||
assertTrue(sans.contains("host.docker.internal"),
|
||||
"Certificate SANs should include default 'host.docker.internal'");
|
||||
|
||||
// Should not contain any custom hostnames
|
||||
assertEquals(6, sans.size(),
|
||||
"Certificate SANs should contain exactly 6 default entries (localhost, 127.0.0.1, 0.0.0.0, *.localhost, localhost.floci.io, *.localhost.floci.io)");
|
||||
assertEquals(7, sans.size(),
|
||||
"Certificate SANs should contain exactly 7 default entries (localhost, 127.0.0.1, 0.0.0.0, *.localhost, localhost.floci.io, *.localhost.floci.io, host.docker.internal)");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
@@ -83,6 +83,8 @@ class TlsConfigSourceMetadataPersistenceTest {
|
||||
"Metadata should contain 'localhost.floci.io'");
|
||||
assertTrue(metadata.getHostnames().contains("*.localhost.floci.io"),
|
||||
"Metadata should contain '*.localhost.floci.io'");
|
||||
assertTrue(metadata.getHostnames().contains("host.docker.internal"),
|
||||
"Metadata should contain 'host.docker.internal'");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user