-
-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mqtt: add mTLS authentication using certificates to MQTT (#15563)
- Loading branch information
1 parent
42fa9d2
commit 0157ea6
Showing
9 changed files
with
136 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<template> | ||
<div> | ||
<textarea :id="id" v-model="value" class="form-control" rows="3" /> | ||
<div class="d-flex justify-content-end"> | ||
<button | ||
type="button" | ||
class="btn btn-link btn-sm text-muted pe-0" | ||
@click="openFilePicker" | ||
> | ||
{{ $t("config.general.readFromFile") }} | ||
</button> | ||
<input | ||
type="file" | ||
ref="fileInput" | ||
class="d-none" | ||
@change="readFile" | ||
accept=".crt,.pem,.cer,.csr,.key" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "PropertyCertField", | ||
props: { | ||
id: String, | ||
modelValue: String, | ||
}, | ||
emits: ["update:modelValue"], | ||
computed: { | ||
value: { | ||
get() { | ||
return this.modelValue; | ||
}, | ||
set(value) { | ||
this.$emit("update:modelValue", value); | ||
}, | ||
}, | ||
}, | ||
methods: { | ||
openFilePicker() { | ||
this.$refs.fileInput.click(); | ||
}, | ||
readFile(event) { | ||
const file = event.target.files[0]; | ||
const reader = new FileReader(); | ||
reader.onload = (e) => { | ||
this.value = e.target.result; | ||
}; | ||
reader.readAsText(file); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters