@@ -51,15 +51,6 @@ if (typeof process.env.ENVFILE === "string" && process.env.ENVFILE.trim()) {
5151 dotenv . config ( ) ;
5252}
5353
54-
55- // WARNING: this is tweak introduced with introduction of https for local development vvv
56- // WARNING: this is tweak introduced with introduction of https for local development vvv
57- // WARNING: this is tweak introduced with introduction of https for local development vvv
58- process . env . NODE_API_PORT = process . env . NODE_API_PORT_HTTPS ;
59- // WARNING: this is tweak introduced with introduction of https for local development ^^^
60- // WARNING: this is tweak introduced with introduction of https for local development ^^^
61- // WARNING: this is tweak introduced with introduction of https for local development ^^^
62-
6354mockEnv ( process . env ) ;
6455
6556const protocolRegex = / ^ h t t p s ? : \/ \/ / ;
@@ -169,18 +160,12 @@ const config = {
169160 name : "chromium" ,
170161 use : {
171162 ...devices [ "Desktop Chrome" ] ,
172- launchOptions : {
173- args : [ "--ignore-certificate-errors" ] , // https://stackoverflow.com/a/76610601
174- } ,
175163 } ,
176164 } ,
177165 {
178166 name : "firefox" ,
179167 use : {
180168 ...devices [ "Desktop Firefox" ] ,
181- launchOptions : {
182- args : [ "--ignore-certificate-errors" ] , // https://stackoverflow.com/a/76610601
183- } ,
184169 } ,
185170 } ,
186171 // { // too much problems with running tests - commenting out
@@ -229,6 +214,37 @@ const config = {
229214 // },
230215} ;
231216
217+ if ( protocolRegex . test ( process . env . BASE_URL ) ) {
218+ log ( `BASE_URL https protocol detected: ${ process . env . BASE_URL } - tweaking configuration` ) ;
219+
220+ // Add ignoreHTTPSErrors to global use configuration
221+ config . use . ignoreHTTPSErrors = true ;
222+
223+ // Configure enhanced SSL error handling for Chromium
224+ const chromiumProject = config . projects . find ( ( p ) => p . name === "chromium" ) ;
225+ if ( chromiumProject ) {
226+ chromiumProject . use . launchOptions = {
227+ args : [
228+ "--ignore-certificate-errors" ,
229+ "--ignore-ssl-errors" ,
230+ "--ignore-certificate-errors-spki-list" ,
231+ "--disable-web-security" ,
232+ "--allow-running-insecure-content" ,
233+ "--disable-features=VizDisplayCompositor" ,
234+ ] , // Enhanced SSL error handling for self-signed certificates
235+ } ;
236+ log ( `Chromium SSL configuration tweaks applied` ) ;
237+ }
238+
239+ // Configure SSL error handling for Firefox
240+ const firefoxProject = config . projects . find ( ( p ) => p . name === "firefox" ) ;
241+ if ( firefoxProject ) {
242+ firefoxProject . use . launchOptions = {
243+ args : [ "--ignore-certificate-errors" ] , // Firefox uses different flags
244+ } ;
245+ log ( `Firefox SSL configuration tweaks applied` ) ;
246+ }
247+ }
232248/**
233249 * Above just standard default config, and below we will modify it the way we need
234250 */
0 commit comments