Index: /branches/amp_4_0/scripts/check_build.py
===================================================================
--- /branches/amp_4_0/scripts/check_build.py	(revision 2748)
+++ /branches/amp_4_0/scripts/check_build.py	(working copy)
@@ -50,6 +50,11 @@
     sys.exit(1)  # Exit the script if the database connection fails
 
 try:
+    # ToDo: Check why this was removed earlier.
+    cur.execute('''CREATE TABLE IF NOT EXISTS device_build_up_info
+                   (device_name varchar(32) PRIMARY KEY     NOT NULL,
+                    current_version varchar(64)    NOT NULL,
+                    new_version varchar(64));''')
     # Clear existing data before inserting new data
     cur.execute('DELETE FROM device_build_up_info;')
     conn.commit()
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/cm/models/system/user_mgmt/__init__.py
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/cm/models/system/user_mgmt/__init__.py	(revision 2748)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/cm/models/system/user_mgmt/__init__.py	(working copy)
@@ -306,6 +306,8 @@
             if data:
                 key = ['username', 'root', 'user_type', 'role_id']
                 result = dict(zip(key, data))
+                if result['role_id'] is None:
+                    result['role_id'] = 0
                 return {"result": result}
             else:
                 return {"result": {'username': username, 'root': False, 'user_type': 'Common Admin', 'role_id': '0'}}
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/apv-ssl-management/apv-ssl-management.ts
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/apv-ssl-management/apv-ssl-management.ts	(revision 2748)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/apv-ssl-management/apv-ssl-management.ts	(working copy)
@@ -11,6 +11,7 @@
 import {Storage} from '../../services/storage';
 import {FormBuilder, FormGroup, Validators} from '@angular/forms';
 import {VpnService} from '../../services/vpn-service';
+import {DevicesBuildInfoDialog} from '../sub-components/devices/devices';
 
 
 @Component({
@@ -174,6 +175,11 @@
   }
 
   checkCertificateExpiry() {
+    this.dialogConfig.width = '40%';
+    this.dialogConfig.height = '60%';
+    const dialogRef = this.dialog.open(APVVSSSLInfoDialog, this.dialogConfig);
+    dialogRef.afterClosed().subscribe(result => {
+    })
   }
 
   goToDetails(_ssl: any) {
@@ -238,10 +244,50 @@
       error: (error: any) => {
         this._notification.showError(error?.message);
       }
+    })
+  }
+
+  onCancel(): void {
+    this.dialogRef.close(false);
+  }
+}
+
+@Component({
+  selector: 'apv-vs-ssl-info', templateUrl: './check-apv-vs-certificate-expiry.html', imports: [SharedModule],
+})
+export class APVVSSSLInfoDialog implements OnInit {
+  readonly dialogRef = inject(MatDialogRef<APVVSSSLInfoDialog>);
+
+  sslInfo: any[] = [];
+  displayedColumns: string[] = ['serial', 'deviceName', 'serviceName', 'sslHostname', 'type', 'days'];
+  dataSource = new MatTableDataSource(this.sslInfo);
+
+  constructor(private _device: DeviceService, private _notification: NotificationService) {
+  }
+
+  ngOnInit() {
+    // ToDo: Fix the UI view once the APIs are ready.
+    setTimeout(() => {
+      this.getSSLInfo();
     })
   }
 
   onCancel(): void {
     this.dialogRef.close(false);
   }
+
+  getSSLInfo(): void {
+    this._device.getAPVVSSSLInfo()
+      .pipe(take(1))
+      .subscribe({
+        next: (result: any) => {
+          if (result && result.length > 0) {
+            this.sslInfo = result;
+            this.dataSource = new MatTableDataSource(this.sslInfo);
+          }
+        }, error: (error: { message: string; }) => {
+          this._notification.showError(error.message);
+        }
+      })
+  }
 }
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/apv-ssl-management/check-apv-vs-certificate-expiry.html
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/apv-ssl-management/check-apv-vs-certificate-expiry.html	(nonexistent)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/apv-ssl-management/check-apv-vs-certificate-expiry.html	(working copy)
@@ -0,0 +1,51 @@
+<h2 mat-dialog-title>Certificate Expire Check</h2>
+
+<mat-dialog-content>
+  <div class="table-container">
+    <!--    <mat-form-field appearance="outline">-->
+    <!--      <mat-label>Search Device</mat-label>-->
+    <!--      <input matInput (keyup)="applyFilter($event)" placeholder="Ex. Array" #input>-->
+    <!--    </mat-form-field>-->
+
+    <table mat-table [dataSource]="dataSource" class="mat-elevation-z1">
+      <ng-container matColumnDef="serial">
+        <th mat-header-cell *matHeaderCellDef> No.</th>
+        <td mat-cell *matCellDef="let element; let i = index;"> {{ i + 1 }}</td>
+      </ng-container>
+      <ng-container matColumnDef="deviceName">
+        <th mat-header-cell *matHeaderCellDef> Device Name</th>
+        <td mat-cell *matCellDef="let element"> {{ element[0] }}</td>
+      </ng-container>
+      <ng-container matColumnDef="serviceName">
+        <th mat-header-cell *matHeaderCellDef> Service Name</th>
+        <td mat-cell *matCellDef="let element"> {{ element[0] }}</td>
+      </ng-container>
+      <ng-container matColumnDef="sslHostname">
+        <th mat-header-cell *matHeaderCellDef> SSL Hostname</th>
+        <td mat-cell *matCellDef="let element"> {{ element[1] }}</td>
+      </ng-container>
+      <ng-container matColumnDef="type">
+        <th mat-header-cell *matHeaderCellDef> Certificate Type</th>
+        <td mat-cell *matCellDef="let element">{{ element[0]}}</td>
+      </ng-container>
+      <ng-container matColumnDef="days">
+        <th mat-header-cell *matHeaderCellDef> Days before expiration</th>
+        <td mat-cell *matCellDef="let element"> {{ element[1] }}</td>
+      </ng-container>
+      <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
+      <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
+      <tr class="mat-row table-no-data" *matNoDataRow>
+        <td class="mat-cell" colspan="9">No results found.</td>
+      </tr>
+    </table>
+  </div>
+</mat-dialog-content>
+
+<mat-dialog-actions align="end">
+  <button
+    mat-button
+    color="basic"
+    (click)="onCancel()">
+    Close
+  </button>
+</mat-dialog-actions>
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/apv-ssl-certificate-backup-restore/apv-ssl-certificate-backup-restore.html
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/apv-ssl-certificate-backup-restore/apv-ssl-certificate-backup-restore.html	(revision 2748)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/apv-ssl-certificate-backup-restore/apv-ssl-certificate-backup-restore.html	(working copy)
@@ -25,8 +25,8 @@
         <div class="row-action a-link">
           <fa-icon [icon]="['fas', 'gears']" size="lg" matTooltip="Restore Certificate"
                    (click)="restoreBackupSSLCertificate(element)"></fa-icon>
-<!--          <fa-icon [icon]="['far', 'circle-down']" size="lg" matTooltip="Download Certificate"-->
-<!--                   (click)="downloadBackupSSLCertificate(element)"></fa-icon>-->
+          <fa-icon [icon]="['far', 'circle-down']" size="lg" matTooltip="Download Certificate"
+                   (click)="downloadBackupSSLCertificate(element)"></fa-icon>
           <fa-icon [icon]="['far', 'trash-can']" size="lg" class="delete-icon" matTooltip="Delete Certificate"
                    (click)="deleteBackupSSLCertificate(element)"></fa-icon>
         </div>
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/apv-ssl-certificate-backup-restore/apv-ssl-certificate-backup-restore.ts
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/apv-ssl-certificate-backup-restore/apv-ssl-certificate-backup-restore.ts	(revision 2748)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/components/sub-components/apv-ssl-certificate-backup-restore/apv-ssl-certificate-backup-restore.ts	(working copy)
@@ -122,32 +122,44 @@
   }
 
   downloadBackupSSLCertificate(_cert: any) {
+    let originalFilename: string = _cert?.filename;
     let payload: any = {
-      asso_targets: this.hostName + '-' + _cert?.filename + '-',
+      asso_targets: this.hostName + '-' + originalFilename + '-',
       targets: this.hostName,
     };
-    // ToDo: Fix the SSL download certificate - https://arraynetworks.atlassian.net/browse/AE-2098
-    // this._device.downloadSSLCertificate(this.deviceName, payload)
-    //   .pipe(take(1))
-    //   .subscribe({
-    //     next: (resp: any) => {
-    //       if (resp) {
-    //         console.log(resp);
-    //         let blob = new Blob([resp], {type: "application/octet-stream"});
-    //         let link = document.createElement("a");
-    //         link.href = window.URL.createObjectURL(blob);
-    //         link.download = _cert?.filename;
-    //         document.body.appendChild(link);
-    //         link.click();
-    //         document.body.removeChild(link);
-    //       }
-    //       this._cdRef.detectChanges();
-    //     },
-    //     error: (error: any) => {
-    //       this._notification.showError(error.message);
-    //       this._cdRef.detectChanges();
-    //     }
-    //   });
+    this._device.downloadSSLCertInfo(this.deviceName, payload)
+      .pipe(take(1))
+      .subscribe({
+        next: (resp: any) => {
+          if (resp && resp.app && resp.filename) {
+            if (resp) {
+              this._device.downloadSSLCertificate(this.deviceName, resp.app, resp.filename)
+                .pipe(take(1))
+                .subscribe({
+                  next: (res: Blob) => {
+                    let blob = new Blob([res], {type: "application/octet-stream"});
+                    let link = document.createElement("a");
+                    link.href = window.URL.createObjectURL(blob);
+                    link.download = originalFilename;
+                    document.body.appendChild(link);
+                    link.click();
+                    document.body.removeChild(link);
+                    window.URL.revokeObjectURL(link.href);
+                  },
+                  error: (error: any) => {
+                    this._notification.showError(error.message);
+                    this._cdRef.detectChanges();
+                  }
+                });
+            }
+          }
+          this._cdRef.detectChanges();
+        },
+        error: (error: any) => {
+          this._notification.showError(error.message);
+          this._cdRef.detectChanges();
+        }
+      });
   }
 
   deleteBackupSSLCertificate(_cert: any) {
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/constants/api_urls.ts
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/constants/api_urls.ts	(revision 2750)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/constants/api_urls.ts	(working copy)
@@ -10,6 +10,7 @@
   ADD_DEVICE_GROUP_URL: `${PREFIX}/api/cm/device_mgmt/device_group/DeviceGroup/_add`,
   DELETE_DEVICE_GROUPS_URL: `${PREFIX}/api/cm/device_mgmt/device_group/DeviceGroup/_delete`,
   CHECK_DEVICE_BUILD_INFO_URL: `${PREFIX}/cm/check_build_info`,
+  CHECK_APV_VS_SSL_CERT_INFO_URL: `${PREFIX}/cm/check_adc_ssl_cert`,
   GET_DEVICE_TYPE_URL: `${PREFIX}/cm/get_device_type`,
   ADD_DEVICE_URL: `${PREFIX}/api/cm/device_mgmt/device/Device/_add`,
   DELETE_DEVICE_URL: `${PREFIX}/api/cm/device_mgmt/device/Device/_delete`,
@@ -146,7 +147,8 @@
   BACKUP_SSL_VHOST_CERTIFICATE_URL: `${PREFIX}/proxy_req_dev/rest/loadbalancing/slb/ssl/SSLVirtualHost/_Backup`,
   RESTORE_SSL_VHOST_CERTIFICATE_URL: `${PREFIX}/proxy_req_dev/rest/loadbalancing/slb/ssl/SSLVirtualHost/_Restore`,
   DELETE_SSL_VHOST_BACKUP_CERTIFICATE_URL: `${PREFIX}/proxy_req_dev/rest/loadbalancing/slb/ssl/SSLVirtualHost/_Delete_BackupCert`,
-  DOWNLOAD_SSL_VHOST_BACKUP_CERTIFICATE_URL: `${PREFIX}/proxy_req_dev/rest/loadbalancing/slb/ssl/SSLVirtualHost/_DownloadSavedFile`,
+  DOWNLOAD_SSL_VHOST_BACKUP_CERTIFICATE_INFO_URL: `${PREFIX}/proxy_req_dev/rest/loadbalancing/slb/ssl/SSLVirtualHost/_DownloadSavedFile`,
+  DOWNLOAD_SSL_VHOST_BACKUP_CERTIFICATE_FILE_URL: `${PREFIX}/proxy_req_dev/pest/localfile`,
   IMPORT_SSL_CERTIFICATE_URL: `${PREFIX}/proxy_req_dev/rest/loadbalancing/slb/ssl/SSLVirtualHost/_Import_Cert`,
   IMPORT_SSL_INTER_CA_CERTIFICATE_URL: `${PREFIX}/proxy_req_dev/rest/loadbalancing/slb/ssl/SSLVirtualHost/_ImportIntercaCert`,
   ACTIVATE_SSL_CERTIFICATE_URL: `${PREFIX}/proxy_req_dev/rest/loadbalancing/slb/ssl/SSLVirtualHost/_Activate`,
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/services/device-service.ts
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/services/device-service.ts	(revision 2750)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/services/device-service.ts	(working copy)
@@ -67,6 +67,10 @@
 
   getDeviceBuildInfo() {
     return this.http.get(URLS.CHECK_DEVICE_BUILD_INFO_URL);
+  }
+
+  getAPVVSSSLInfo() {
+    return this.http.get(URLS.CHECK_APV_VS_SSL_CERT_INFO_URL);
   }
 
   getDeviceTypeList() {
@@ -477,8 +481,8 @@
     );
   }
 
-  downloadSSLCertificate(aGName: string | null, rawPayload: any) {
-    return this.http.post(URLS.DOWNLOAD_SSL_VHOST_BACKUP_CERTIFICATE_URL, rawPayload, {
+  downloadSSLCertInfo(aGName: string | null, rawPayload: any) {
+    return this.http.post(URLS.DOWNLOAD_SSL_VHOST_BACKUP_CERTIFICATE_INFO_URL, rawPayload, {
         csrf: true,
         isFormData: true,
         csrfInFormData: true
@@ -486,6 +490,22 @@
         {name: 'Cm-Data', value: aGName},
         {name: 'Cm-Type', value: 'device'}
       ]
+    );
+  }
+
+  downloadSSLCertificate(deviceName: string | null, hostname: string, filename: string) {
+    const options: any = {
+      responseType: 'blob',
+      withCredentials: true
+    };
+    const customHeaders = [
+      { name: 'Cm-Data', value: deviceName || '' },
+      { name: 'Cm-Type', value: 'device' }
+    ];
+    return this.http.get<Blob>(
+      `${URLS.DOWNLOAD_SSL_VHOST_BACKUP_CERTIFICATE_FILE_URL}/${hostname}/${filename}`,
+      options,
+      customHeaders
     );
   }
 
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/services/http.ts
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/services/http.ts	(revision 2748)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/gui/src/app/services/http.ts	(working copy)
@@ -17,6 +17,7 @@
   params?: { [key: string]: string | number | boolean };
   responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
   observe?: 'body';
+  withCredentials?: boolean;
 };
 
 @Injectable({ providedIn: 'root' })
@@ -28,6 +29,7 @@
     context: HttpContext;
     params?: HttpParams;
     observe?: 'body';
+    withCredentials?: boolean;
   } {
     let context = new HttpContext()
       .set(ADD_CSRF_TO_PAYLOAD, options?.csrf ?? false)
@@ -37,14 +39,15 @@
     const params = options?.params
       ? new HttpParams({ fromObject: options.params as any })
       : undefined;
-    const { responseType, observe } = options || {};
+    const { responseType, observe, withCredentials } = options || {};
 
     return {
       headers: new HttpHeaders(headers),
       context,
       ...(params ? { params } : {}),
       ...(responseType ? { responseType } : {}),
-      ...(observe ? { observe } : {})
+      ...(observe ? { observe } : {}),
+      ...(withCredentials ? { withCredentials } : {})
     };
   }
 
