Skip to content

Fix local upload from browser failing due to ssvm cert not trusted#13204

Open
abh1sar wants to merge 1 commit into
apache:4.20from
shapeblue:ssvm-upload
Open

Fix local upload from browser failing due to ssvm cert not trusted#13204
abh1sar wants to merge 1 commit into
apache:4.20from
shapeblue:ssvm-upload

Conversation

@abh1sar
Copy link
Copy Markdown
Contributor

@abh1sar abh1sar commented May 21, 2026

Description

This PR fixes #12490

UI Pre-check
Before initiating upload, have the UI make a test request to the SSVM and guide users to accept the certificate if needed.

Fixed Template, ISO and Volume upload.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Screen.recording.mov

How did you try to break this feature and the system with this change?

@abh1sar abh1sar requested a review from vishesh92 May 21, 2026 04:02
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.26%. Comparing base (a7c2a05) to head (700f4e0).
⚠️ Report is 2 commits behind head on 4.20.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #13204      +/-   ##
============================================
- Coverage     16.27%   16.26%   -0.01%     
+ Complexity    13440    13433       -7     
============================================
  Files          5665     5665              
  Lines        500555   500628      +73     
  Branches      60789    60797       +8     
============================================
- Hits          81445    81417      -28     
- Misses       410004   410103      +99     
- Partials       9106     9108       +2     
Flag Coverage Δ
uitests 4.14% <ø> (-0.01%) ⬇️
unittests 17.11% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a UI-side pre-check for SSVM reachability/certificate trust before starting “upload from local” flows, so browser-blocked requests (e.g., due to an expired/untrusted SSVM TLS cert) can be surfaced with user guidance instead of failing silently.

Changes:

  • Introduces an SSVM “certificate not trusted” warning state with actions to open the SSVM origin and retry.
  • Adds a lightweight fetch() probe before initiating template/ISO/volume uploads to detect browser-level connection/TLS failures.
  • Adds new i18n strings for the warning and retry actions.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
ui/src/views/storage/UploadLocalVolume.vue Adds SSVM probe + warning UI and refactors upload to use an uploading state.
ui/src/views/image/RegisterOrUploadTemplate.vue Adds SSVM probe + warning UI for local template uploads, with retry flow.
ui/src/views/image/RegisterOrUploadIso.vue Adds SSVM probe + warning UI for local ISO uploads, with retry flow.
ui/public/locales/en.json Adds UI strings for the SSVM warning and retry actions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

message: this.$t('message.upload.volume.failed'),
description: this.$t('message.upload.file.limit'),
duration: 0
})
Comment thread ui/public/locales/en.json
Comment on lines +3672 to +3674
"message.ssvm.cert.untrusted": "The upload server certificate is not trusted by your browser.",
"message.ssvm.cert.trust.instructions": "Click 'Open Certificate Page' to open the upload server in a new browser tab. Accept the certificate warning shown by your browser, then come back here and click 'Retry Upload'.",
"message.ssvm.cert.still.untrusted": "The certificate still appears untrusted. Please accept it in the opened tab and try again.",
Comment on lines +290 to +294
try {
await fetch(origin, { method: 'HEAD', mode: 'no-cors' })
return true
} catch (e) {
return false
Comment on lines +632 to +636
try {
await fetch(origin, { method: 'HEAD', mode: 'no-cors' })
return true
} catch (e) {
return false
Comment on lines +511 to +516
async probeSsvmCert (origin) {
try {
await fetch(origin, { method: 'HEAD', mode: 'no-cors' })
return true
} catch (e) {
return false
Comment on lines +631 to +649
async probeSsvmCert (origin) {
try {
await fetch(origin, { method: 'HEAD', mode: 'no-cors' })
return true
} catch (e) {
return false
}
},
async retryUpload () {
this.loading = true
const trusted = await this.probeSsvmCert(this.ssvmOrigin)
this.loading = false
if (!trusted) {
this.$message.warning(this.$t('message.ssvm.cert.still.untrusted'))
return
}
this.ssvmCertUntrusted = false
this.handleUpload()
},
Comment on lines 19 to 24
<div class="form-layout" v-ctrl-enter="handleSubmit">
<span v-if="uploadPercentage > 0">
<span v-if="uploading">
<loading-outlined />
{{ $t('message.upload.file.processing') }}
<a-progress :percent="uploadPercentage" />
</span>
Copy link
Copy Markdown
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm. didn't test.
IMO, it would be better if we can extract the common code out.

@vishesh92
Copy link
Copy Markdown
Member

@abh1sar please check the copilot's comments and see if they are valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local template/ISO upload fails silently due to expired SSL certificate on SSVM

3 participants