Skip to content

Commit 7665cfc

Browse files
committed
fixup! fix(@angular/build): simplify SSL handling for with SSR
1 parent 7d2576d commit 7665cfc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/angular/build/src/tools/vite/plugins/ssr-ssl-plugin.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ export function createAngularServerSideSSLPlugin(): Plugin {
1616
async configureServer({ config, httpServer }) {
1717
const {
1818
ssr,
19-
server: { https: cert },
19+
server: { https },
2020
} = config;
2121

22-
if (!ssr || !cert) {
22+
if (!ssr || !https?.cert) {
2323
return;
2424
}
2525

2626
// TODO(alanagius): Replace `undici` with `tls.setDefaultCACertificates` once we only support Node.js 22.18.0+ and 24.5.0+.
2727
// See: https://nodejs.org/api/tls.html#tlssetdefaultcacertificatescerts
2828
const { getGlobalDispatcher, setGlobalDispatcher, Agent } = await import('undici');
2929
const originalDispatcher = getGlobalDispatcher();
30+
const { cert } = https;
3031
const certificates = Array.isArray(cert) ? cert : [cert];
3132

3233
setGlobalDispatcher(

0 commit comments

Comments
 (0)