@@ -19,15 +19,19 @@ async function run(): Promise<string> {
1919
2020 Task . debug ( taskInput . toJSON ( ) ) ;
2121 Task . debug ( 'Executing SSL Labs Scan with the given inputs' ) ;
22+ console . log ( `Starting SSL Labs Scan for the hostname: ${ taskInput . Hostname } ` ) ;
2223
2324 const scanResult = await sslLabsService . executeSslTest ( ) ;
25+ console . log ( 'Scan Completed...' ) ;
26+
2427
2528 // Check for Verifications
2629 if ( taskInput . EnableVerification ) {
30+ console . log ( `Verifications are Enabled with the Alert Mode: ${ taskInput . AlertMode } ` ) ;
2731 const certGradeScore = await sslLabsService . getSslCertificateGrade ( scanResult ) ;
2832
2933 if ( Number ( taskInput . MinimumCertGrade ) > certGradeScore ) {
30-
34+ console . log ( 'Minimum certifiate grade threshold exceeded. Executing Alert' ) ;
3135 // If certificate grade threshold is passed
3236 switch ( taskInput . AlertMode ) {
3337 case AlertMode . BREAK_BUILD :
@@ -41,12 +45,14 @@ async function run(): Promise<string> {
4145 }
4246
4347 if ( taskInput . EnableExpirationAlert ) {
44- const timeDiff : number = await sslLabsService . timeTillCertificateExpiration ( scanResult ) ;
48+ console . log ( 'Certificate expiration alerts Enabled.' ) ;
49+ const daysTillExpire : number = await sslLabsService . timeTillCertificateExpiration ( scanResult ) ;
4550
46- if ( timeDiff < taskInput . DaysBeforeExpiration ) {
51+ if ( daysTillExpire < taskInput . DaysBeforeExpiration ) {
52+ console . log ( 'Minimum certifiate expire threshold exceeded. Executing Alert' ) ;
4753 switch ( taskInput . AlertMode ) {
4854 case AlertMode . BREAK_BUILD :
49- throw new Error ( `SSL certificate is nearing expireation and will expire in ${ timeDiff } Days.` ) ;
55+ throw new Error ( `SSL certificate is nearing expireation and will expire in ${ daysTillExpire } Days.` ) ;
5056
5157 case AlertMode . SET_VARIABLE :
5258 Task . setVariable ( taskInput . VariableName , taskInput . VariableContent , false ) ;
@@ -65,11 +71,9 @@ async function run(): Promise<string> {
6571
6672run ( )
6773 . then ( ( res : string ) => {
68- console . log ( res ) ;
6974 Task . setResult ( Task . TaskResult . Succeeded , res ) ;
7075 } )
7176 . catch ( ( err : any ) => {
7277 const msg = `Task Failed. Error: ${ JSON . stringify ( err ) } ` ;
73- console . log ( msg ) ;
7478 Task . setResult ( Task . TaskResult . Failed , msg ) ;
7579 } ) ;
0 commit comments