File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,10 +81,10 @@ function mergeConfigurations(
8181 // If user doesn't specify tls but has legacy SSL fields, use only legacy fallback
8282 if ( ! userSettings . tls && ( userSettings . sslKeyPemPath || userSettings . sslCertPemPath ) ) {
8383 tlsConfig = {
84- ... defaultConfig . tls ,
85- // Clear the default key/cert paths so legacy fallback works
86- key : undefined as any ,
87- cert : undefined as any ,
84+ enabled : defaultConfig . tls ?. enabled || false ,
85+ // Use empty strings so legacy fallback works
86+ key : '' ,
87+ cert : '' ,
8888 } ;
8989 }
9090
@@ -257,12 +257,12 @@ export const getPlugins = () => {
257257
258258export const getTLSKeyPemPath = ( ) : string | undefined => {
259259 const config = loadFullConfiguration ( ) ;
260- return config . tls ?. key || config . sslKeyPemPath ;
260+ return ( config . tls ?. key && config . tls . key !== '' ) ? config . tls . key : config . sslKeyPemPath ;
261261} ;
262262
263263export const getTLSCertPemPath = ( ) : string | undefined => {
264264 const config = loadFullConfiguration ( ) ;
265- return config . tls ?. cert || config . sslCertPemPath ;
265+ return ( config . tls ?. cert && config . tls . cert !== '' ) ? config . tls . cert : config . sslCertPemPath ;
266266} ;
267267
268268export const getTLSEnabled = ( ) : boolean => {
Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ const options: ServerOptions = {
3030 inflate : true ,
3131 limit : '100000kb' ,
3232 type : '*/*' ,
33- key : getTLSEnabled ( ) ? fs . readFileSync ( getTLSKeyPemPath ( ) ) : undefined ,
34- cert : getTLSEnabled ( ) ? fs . readFileSync ( getTLSCertPemPath ( ) ) : undefined ,
33+ key : getTLSEnabled ( ) && getTLSKeyPemPath ( ) ? fs . readFileSync ( getTLSKeyPemPath ( ) ! ) : undefined ,
34+ cert : getTLSEnabled ( ) && getTLSCertPemPath ( ) ? fs . readFileSync ( getTLSCertPemPath ( ) ! ) : undefined ,
3535} ;
3636
3737export const proxyPreparations = async ( ) => {
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ router.use(teeAndValidate);
113113
114114router . use (
115115 '/' ,
116- proxy ( getProxyUrl ( ) , {
116+ proxy ( getProxyUrl ( ) || '' , {
117117 parseReqBody : false ,
118118 preserveHostHdr : false ,
119119
You can’t perform that action at this time.
0 commit comments