Skip to content

Commit 37c7b55

Browse files
committed
dev(local): import Cosmos emulator cert into DAB container trust store
1 parent eea3894 commit 37c7b55

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/run-local.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ $cosmosConnForHost = "AccountEndpoint=https://localhost:${CosmosHostPort}/;Accou
9090

9191
Start-Dab -network 'stamps-net' -containerName $dabContainer -dabPort $DabPort -dabConfigPath '.\management-portal\dab\dab-config.json' -cosmosConn $cosmosConnForContainers
9292

93+
# Install emulator certificate into DAB container trust store
94+
$pem = Join-Path $env:TEMP "cosmos-emulator.pem"
95+
try { Invoke-WebRequest -Uri "https://localhost:${CosmosHostPort}/_explorer/emulator.pem" -OutFile $pem -SkipCertificateCheck } catch {}
96+
if (Test-Path $pem) {
97+
docker cp $pem ${dabContainer}:/usr/local/share/ca-certificates/cosmos-emulator.crt | Out-Null
98+
docker exec ${dabContainer} update-ca-certificates | Out-Null
99+
}
100+
93101
# Wait for DAB GraphQL
94102
Wait-Http -url "http://localhost:${DabPort}/graphql" -timeoutSec 120
95103

0 commit comments

Comments
 (0)