@@ -58,6 +58,22 @@ export async function initialize(context: ExtensionContext) {
58
58
}
59
59
}
60
60
61
+ if ( config . debugIsSecure ) {
62
+ if ( ! await certificates . localClientCertExists ( connection ) ) {
63
+ vscode . window . showInformationMessage ( `Debug Service Certificates` , {
64
+ modal : true ,
65
+ detail : `Debug client certificate is not setup.`
66
+ } ,
67
+ `Setup`
68
+ ) . then ( result => {
69
+ if ( result === `Setup` ) {
70
+ vscode . commands . executeCommand ( `code-for-ibmi.debug.setup.local` ) ;
71
+ }
72
+ } ) ;
73
+ return ;
74
+ }
75
+ }
76
+
61
77
if ( password ) {
62
78
const debugOpts : DebugOptions = {
63
79
password,
@@ -241,11 +257,6 @@ export async function initialize(context: ExtensionContext) {
241
257
remoteCertsOk = true ;
242
258
remoteCertsAreNew = true ;
243
259
}
244
-
245
- // Download the client certificates to the device if setup correctly.
246
- if ( remoteCertsOk ) {
247
- vscode . commands . executeCommand ( `code-for-ibmi.debug.setup.local` ) ;
248
- }
249
260
} catch ( e : any ) {
250
261
vscode . window . showErrorMessage ( e . message || e ) ;
251
262
}
@@ -433,11 +444,10 @@ export async function initialize(context: ExtensionContext) {
433
444
}
434
445
}
435
446
} else {
436
- const openTut = await vscode . window . showInformationMessage ( `${
437
- existingDebugService ?
438
- `Looks like the Debug Service was started by an external service. This may impact your VS Code experience.` :
447
+ const openTut = await vscode . window . showInformationMessage ( `${ existingDebugService ?
448
+ `Looks like the Debug Service was started by an external service. This may impact your VS Code experience.` :
439
449
`Looks like you have the debug PTF but don't have it configured.`
440
- } Do you want to see the Walkthrough to set it up?`, `Take me there` ) ;
450
+ } Do you want to see the Walkthrough to set it up?`, `Take me there` ) ;
441
451
442
452
if ( openTut === `Take me there` ) {
443
453
vscode . commands . executeCommand ( `workbench.action.openWalkthrough` , `halcyontechltd.vscode-ibmi-walkthroughs#code-ibmi-debug` ) ;
@@ -450,12 +460,12 @@ export async function initialize(context: ExtensionContext) {
450
460
vscode . commands . executeCommand ( `setContext` , `code-for-ibmi:debugManaged` , isManaged ( ) ) ;
451
461
}
452
462
453
- function validateIPv4address ( ipaddress : string ) {
454
- if ( / ^ ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \. ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \. ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \. ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) $ / . test ( ipaddress ) ) {
455
- return ( true )
463
+ function validateIPv4address ( ipaddress : string ) {
464
+ if ( / ^ ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \. ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \. ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \. ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) $ / . test ( ipaddress ) ) {
465
+ return ( true )
456
466
}
457
- return ( false )
458
- }
467
+ return ( false )
468
+ }
459
469
460
470
interface DebugOptions {
461
471
password : string ;
0 commit comments