@@ -145,6 +145,10 @@ export interface ICertificateManagerOptions extends ICertificateStoreOptions {}
145145
146146const MAX_CERTIFICATE_VALIDITY_DAYS : 365 = 365 ;
147147
148+ const VS_CODE_EXTENSION_FIX_MESSAGE : string =
149+ 'Use the "Debug Certificate Manager" Extension for VS Code (ms-RushStack.debug-certificate-manager) and run the ' +
150+ '"Debug Certificate Manager: Ensure and Sync TLS Certificates" command to fix certificate issues. ' ;
151+
148152/**
149153 * A utility class to handle generating, trusting, and untrustring a debug certificate.
150154 * Contains two public methods to `ensureCertificate` and `untrustCertificate`.
@@ -177,7 +181,8 @@ export class CertificateManager {
177181 if ( process . env [ DISABLE_CERT_GENERATION_VARIABLE_NAME ] === '1' ) {
178182 // Allow the environment (e.g. GitHub codespaces) to forcibly disable dev cert generation
179183 terminal . writeLine (
180- `Found environment variable ${ DISABLE_CERT_GENERATION_VARIABLE_NAME } =1, disabling certificate generation.`
184+ `Found environment variable ${ DISABLE_CERT_GENERATION_VARIABLE_NAME } =1, disabling certificate generation. ` +
185+ VS_CODE_EXTENSION_FIX_MESSAGE
181186 ) ;
182187 canGenerateNewCertificate = false ;
183188 }
@@ -207,7 +212,8 @@ export class CertificateManager {
207212 } else {
208213 validationResult . validationMessages . push (
209214 'Untrust the certificate and generate a new one, or set the ' +
210- '`canGenerateNewCertificate` parameter to `true` when calling `ensureCertificateAsync`.'
215+ '`canGenerateNewCertificate` parameter to `true` when calling `ensureCertificateAsync`. ' +
216+ VS_CODE_EXTENSION_FIX_MESSAGE
211217 ) ;
212218 throw new Error ( validationResult . validationMessages . join ( ' ' ) ) ;
213219 }
@@ -216,7 +222,8 @@ export class CertificateManager {
216222 } else {
217223 throw new Error (
218224 'No development certificate found. Generate a new certificate manually, or set the ' +
219- '`canGenerateNewCertificate` parameter to `true` when calling `ensureCertificateAsync`.'
225+ '`canGenerateNewCertificate` parameter to `true` when calling `ensureCertificateAsync`. ' +
226+ VS_CODE_EXTENSION_FIX_MESSAGE
220227 ) ;
221228 }
222229 }
0 commit comments