diff --git a/change/@react-native-windows-cli-4be26f48-0076-4686-9fb4-6fe14a114393.json b/change/@react-native-windows-cli-4be26f48-0076-4686-9fb4-6fe14a114393.json new file mode 100644 index 00000000000..ac6f0ef1be2 --- /dev/null +++ b/change/@react-native-windows-cli-4be26f48-0076-4686-9fb4-6fe14a114393.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Remove the timeout from self-signed certificate generating", + "packageName": "@react-native-windows/cli", + "email": "Bartosz.Klonowski@callstack.com", + "dependentChangeType": "patch" +} diff --git a/packages/@react-native-windows/cli/src/generator-windows/index.ts b/packages/@react-native-windows/cli/src/generator-windows/index.ts index c89691d8554..bd892807d8a 100644 --- a/packages/@react-native-windows/cli/src/generator-windows/index.ts +++ b/packages/@react-native-windows/cli/src/generator-windows/index.ts @@ -34,11 +34,9 @@ async function generateCertificate( console.log('Generating self-signed certificate...'); if (os.platform() === 'win32') { try { - const timeout = 10000; // 10 seconds; const thumbprint = childProcess .execSync( `powershell -NoProfile -Command "Write-Output (New-SelfSignedCertificate -KeyUsage DigitalSignature -KeyExportPolicy Exportable -Subject 'CN=${currentUser}' -TextExtension @('2.5.29.37={text}1.3.6.1.5.5.7.3.3', '2.5.29.19={text}Subject Type:End Entity') -CertStoreLocation 'Cert:\\CurrentUser\\My').Thumbprint"`, - {timeout}, ) .toString() .trim(); @@ -51,14 +49,16 @@ async function generateCertificate( newProjectName, newProjectName, )}_TemporaryKey.pfx -Password $pwd"`, - {timeout}, ); console.log( chalk.green('Self-signed certificate generated successfully.'), ); return thumbprint; } catch (err) { - console.log(chalk.yellow('Failed to generate Self-signed certificate.')); + console.log( + chalk.yellow('Unable to generate the self-signed certificate:'), + ); + console.log(chalk.red(err)); } }