Skip to content

Commit 35d9987

Browse files
slayerjainclaude
andcommitted
fix(sap-demo): default DB URL to 127.0.0.1 + sslmode=disable for keploy-friendly local dev
Spring Boot's default JDBC URL (jdbc:postgresql://localhost:5432/customer360) resolves to ::1 on most Linux stacks and opts in to SSL negotiation. Both break Keploy's eBPF proxy: the v6 connection is not hooked, and the SSL negotiation fails with EOF during the enableSSL packet exchange under the proxy's MITM. Default now binds the v4 loopback and disables SSL so out-of-the-box `keploy record` works without env overrides. Compose (`hostname: postgres`) and the k8s manifests already supply SPRING_DATASOURCE_URL, so the change is invisible to those flows. Reproduction: SPRING_DATASOURCE_URL unset, postgres on localhost → app boots but keploy record sees no v4 traffic → no postgres mocks captured. Root cause: localhost → ::1 on Debian/Ubuntu; postgresql driver negotiates SSL by default. Fix: 127.0.0.1 + ?sslmode=disable as the built-in default; SPRING_DATASOURCE_URL still overrides it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d8c9869 commit 35d9987

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

sap-demo-java/src/main/resources/application.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ spring:
1212
# for the demo we use stock Postgres, which Keploy's OSS core can record
1313
# and replay at the wire-protocol level.
1414
datasource:
15-
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/customer360}
15+
# Default to IPv4 (127.0.0.1) + sslmode=disable so Keploy's eBPF proxy
16+
# can capture the Postgres wire protocol cleanly on the host. The
17+
# `localhost` hostname resolves to ::1 on most modern Linux stacks, and
18+
# the eBPF hooks currently attach only to the v4 path; additionally
19+
# the default postgres driver opts in to SSL negotiation, which fails
20+
# with EOF mid-handshake under the proxy. Compose and k8s override this
21+
# via SPRING_DATASOURCE_URL (hostname: postgres) where those concerns
22+
# don't apply.
23+
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://127.0.0.1:5432/customer360?sslmode=disable}
1624
username: ${SPRING_DATASOURCE_USERNAME:customer360}
1725
password: ${SPRING_DATASOURCE_PASSWORD:customer360}
1826
hikari:

0 commit comments

Comments
 (0)