Skip to content

Commit 36f65b0

Browse files
authored
Tweak certificate errors (#260)
1 parent 1b6840d commit 36f65b0

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## Unreleased
4+
5+
### Changes
6+
7+
- Show certificate errors under the token input.
8+
39
## [v0.1.36](https://github.com/coder/vscode-coder/releases/tag/v0.1.36) (2024-04-09)
410

511
### Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "Coder",
55
"description": "Open any workspace with a single click.",
66
"repository": "https://github.com/coder/vscode-coder",
7-
"version": "0.1.36",
7+
"version": "0.1.37",
88
"engines": {
99
"vscode": "^1.73.0"
1010
},

src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class Commands {
113113
err.showNotification()
114114

115115
return {
116-
message: err.message,
116+
message: err.x509Err || err.message,
117117
severity: vscode.InputBoxValidationSeverity.Error,
118118
}
119119
}

src/error.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export enum X509_ERR_CODE {
1313

1414
// X509_ERR contains human-friendly versions of TLS errors.
1515
export enum X509_ERR {
16-
PARTIAL_CHAIN = "Your Coder deployment's certificate cannot be verified because a certificate is missing from its chain. To fix this your deployment's administrator should bundle the missing certificates or you can add the missing certificates directly to this system's trust store.",
16+
PARTIAL_CHAIN = "Your Coder deployment's certificate cannot be verified because a certificate is missing from its chain. To fix this your deployment's administrator must bundle the missing certificates.",
1717
// NON_SIGNING can be removed if BoringSSL is patched and the patch makes it
1818
// into the version of Electron used by VS Code.
19-
NON_SIGNING = "Your Coder deployment's certificate is not marked as being capable of signing. VS Code uses a version of Electron that does not support certificates like this even if they are self-issued. The certificate should be regenerated with the certificate signing capability.",
20-
UNTRUSTED_LEAF = "Your Coder deployment's certificate does not appear to be trusted by this system. The certificate should be added to this system's trust store.",
21-
UNTRUSTED_CHAIN = "Your Coder deployment's certificate chain does not appear to be trusted by this system. The root of the certificate chain should be added to this system's trust store. ",
19+
NON_SIGNING = "Your Coder deployment's certificate is not marked as being capable of signing. VS Code uses a version of Electron that does not support certificates like this even if they are self-issued. The certificate must be regenerated with the certificate signing capability.",
20+
UNTRUSTED_LEAF = "Your Coder deployment's certificate does not appear to be trusted by this system. The certificate must be added to this system's trust store.",
21+
UNTRUSTED_CHAIN = "Your Coder deployment's certificate chain does not appear to be trusted by this system. The root of the certificate chain must be added to this system's trust store. ",
2222
}
2323

2424
export interface Logger {
@@ -31,7 +31,7 @@ interface KeyUsage {
3131

3232
export class CertificateError extends Error {
3333
public static ActionAllowInsecure = "Allow Insecure"
34-
public static ActionViewMoreDetails = "View More Details"
34+
public static ActionOK = "OK"
3535
public static InsecureMessage =
3636
'The Coder extension will no longer verify TLS on HTTPS requests. You can change this at any time with the "coder.insecure" property in your VS Code settings.'
3737

@@ -116,12 +116,6 @@ export class CertificateError extends Error {
116116
})
117117
}
118118

119-
viewMoreDetails(): Thenable<boolean> {
120-
return vscode.env.openExternal(
121-
vscode.Uri.parse("https://github.com/coder/vscode-coder/issues/115#issuecomment-1631512493"),
122-
)
123-
}
124-
125119
// allowInsecure updates the value of the "coder.insecure" property.
126120
async allowInsecure(): Promise<void> {
127121
vscode.workspace.getConfiguration().update("coder.insecure", true, vscode.ConfigurationTarget.Global)
@@ -146,11 +140,10 @@ export class CertificateError extends Error {
146140
// inside VS Code. Disabling the "Strict SSL" setting does not help
147141
// either. For now avoid showing the button until this is sorted.
148142
// CertificateError.ActionAllowInsecure,
149-
CertificateError.ActionViewMoreDetails,
143+
CertificateError.ActionOK,
150144
)
151145
switch (val) {
152-
case CertificateError.ActionViewMoreDetails:
153-
await this.viewMoreDetails()
146+
case CertificateError.ActionOK:
154147
return
155148
case CertificateError.ActionAllowInsecure:
156149
await this.allowInsecure()

0 commit comments

Comments
 (0)