Skip to content

Commit eb0aba9

Browse files
committed
more useSystemCA false changes
1 parent f0602fa commit eb0aba9

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

packages/compass-e2e-tests/helpers/compass-web-sandbox.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ export const getAtlasCloudSandboxDefaultConnections = (
208208
str.password = dbPassword;
209209
return {
210210
id: name,
211-
connectionOptions: { connectionString: String(str) },
211+
connectionOptions: {
212+
connectionString: String(str),
213+
// System CA certificates are not available in the browser environment
214+
useSystemCA: false,
215+
},
212216
favorite: { name },
213217
};
214218
});

packages/compass-web/sandbox/sandbox-connection-storage.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,31 @@ class SandboxConnectionStorage implements ConnectionStorage {
3636
return [info.id, info];
3737
})
3838
);
39+
40+
// Ensure useSystemCA is set to false for all connections since system CA
41+
// certificates are not available in the browser environment
42+
private normalizeConnectionInfo(info: ConnectionInfo): ConnectionInfo {
43+
return {
44+
...info,
45+
connectionOptions: {
46+
...info.connectionOptions,
47+
useSystemCA: false,
48+
},
49+
};
50+
}
51+
3952
loadAll(): Promise<ConnectionInfo[]> {
40-
return Promise.resolve(Array.from(this._connections.values()));
53+
return Promise.resolve(
54+
Array.from(this._connections.values()).map((info) =>
55+
this.normalizeConnectionInfo(info)
56+
)
57+
);
4158
}
4259
load({ id }: { id: string }): Promise<ConnectionInfo | undefined> {
43-
return Promise.resolve(this._connections.get(id));
60+
const info = this._connections.get(id);
61+
return Promise.resolve(
62+
info ? this.normalizeConnectionInfo(info) : undefined
63+
);
4464
}
4565
save({ connectionInfo }: { connectionInfo: ConnectionInfo }): Promise<void> {
4666
this._connections.set(connectionInfo.id, connectionInfo);

0 commit comments

Comments
 (0)