Fix local upload from browser failing due to ssvm cert not trusted#13204
Fix local upload from browser failing due to ssvm cert not trusted#13204abh1sar wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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 | ||
| }) |
| "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.", |
| try { | ||
| await fetch(origin, { method: 'HEAD', mode: 'no-cors' }) | ||
| return true | ||
| } catch (e) { | ||
| return false |
| try { | ||
| await fetch(origin, { method: 'HEAD', mode: 'no-cors' }) | ||
| return true | ||
| } catch (e) { | ||
| return false |
| async probeSsvmCert (origin) { | ||
| try { | ||
| await fetch(origin, { method: 'HEAD', mode: 'no-cors' }) | ||
| return true | ||
| } catch (e) { | ||
| return false |
| 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() | ||
| }, |
| <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> |
vishesh92
left a comment
There was a problem hiding this comment.
clgtm. didn't test.
IMO, it would be better if we can extract the common code out.
|
@abh1sar please check the copilot's comments and see if they are valid. |
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
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
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?