@@ -33,7 +33,6 @@ import { Schema as BrowserBuilderOptions } from '../browser-esbuild/schema';
33
33
import { loadProxyConfiguration } from './load-proxy-config' ;
34
34
import type { NormalizedDevServerOptions } from './options' ;
35
35
import type { DevServerBuilderOutput } from './webpack-server' ;
36
- import { ConnectionOptions } from 'node:tls' ;
37
36
38
37
interface OutputFileRecord {
39
38
contents : Uint8Array ;
@@ -681,11 +680,9 @@ export async function setupServer(
681
680
}
682
681
683
682
transformIndexHtmlAndAddHeaders ( url , rawHtml , res , next , async ( html ) => {
684
- const url = new URL ( req . originalUrl ?? '/' , server . resolvedUrls ?. local [ 0 ] ) ;
685
-
686
683
const { content } = await renderPage ( {
687
684
document : html ,
688
- route : url . toString ( ) ,
685
+ route : new URL ( req . originalUrl ?? '/' , server . resolvedUrls ?. local [ 0 ] ) . toString ( ) ,
689
686
serverContext : 'ssr' ,
690
687
loadBundle : ( uri : string ) =>
691
688
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -800,25 +797,6 @@ export async function setupServer(
800
797
configuration . plugins ??= [ ] ;
801
798
configuration . plugins . push ( basicSslPlugin ( ) ) ;
802
799
}
803
-
804
- if ( ssr ) {
805
- // Patch the TLS module to allow self signed certificate requests when running SSR.
806
- // We cannot use `NODE_EXTRA_CA_CERTS` as this is only read once when launching Node.js
807
- // and using `NODE_TLS_REJECT_UNAUTHORIZED` would apply globally and a warning is shown.
808
- const tls = await import ( 'node:tls' ) ;
809
- const originalConnect = tls . connect ;
810
- tls . connect = function ( ...args ) {
811
- if ( args && typeof args === 'object' ) {
812
- const options = args [ 0 ] as ConnectionOptions ;
813
- if ( options . host === serverOptions . host && options . port == serverOptions . port ) {
814
- options . rejectUnauthorized = false ;
815
- }
816
- }
817
-
818
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
819
- return originalConnect . apply ( this , args as any ) ;
820
- } ;
821
- }
822
800
}
823
801
824
802
return configuration ;
0 commit comments