Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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));
}
}

Expand Down