Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44f4f08

Browse files
authored
feat: add coder.tlsAltHost option (#398)
1 parentd4ccfa7 commit44f4f08

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

‎package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@
8888
"type":"string",
8989
"default":""
9090
},
91+
"coder.tlsAltHost": {
92+
"markdownDescription":"Alternative hostname to use for TLS verification. This is useful when the hostname in the certificate does not match the hostname used to connect.",
93+
"type":"string",
94+
"default":""
95+
},
9196
"coder.proxyLogDirectory": {
9297
"markdownDescription":"If set, the Coder CLI will output extra SSH information into this directory, which can be helpful for debugging connectivity issues.",
9398
"type":"string",

‎src/api.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ async function createHttpAgent(): Promise<ProxyAgent> {
3131
constcertFile=expandPath(String(cfg.get("coder.tlsCertFile")??"").trim())
3232
constkeyFile=expandPath(String(cfg.get("coder.tlsKeyFile")??"").trim())
3333
constcaFile=expandPath(String(cfg.get("coder.tlsCaFile")??"").trim())
34+
constaltHost=expandPath(String(cfg.get("coder.tlsAltHost")??"").trim())
3435

3536
returnnewProxyAgent({
3637
// Called each time a request is made.
@@ -41,6 +42,7 @@ async function createHttpAgent(): Promise<ProxyAgent> {
4142
cert:certFile==="" ?undefined :awaitfs.readFile(certFile),
4243
key:keyFile==="" ?undefined :awaitfs.readFile(keyFile),
4344
ca:caFile==="" ?undefined :awaitfs.readFile(caFile),
45+
servername:altHost==="" ?undefined :altHost,
4446
// rejectUnauthorized defaults to true, so we need to explicitly set it to
4547
// false if we want to allow self-signed certificates.
4648
rejectUnauthorized:!insecure,
@@ -66,7 +68,8 @@ async function getHttpAgent(): Promise<ProxyAgent> {
6668
e.affectsConfiguration("coder.insecure")||
6769
e.affectsConfiguration("coder.tlsCertFile")||
6870
e.affectsConfiguration("coder.tlsKeyFile")||
69-
e.affectsConfiguration("coder.tlsCaFile")
71+
e.affectsConfiguration("coder.tlsCaFile")||
72+
e.affectsConfiguration("coder.tlsAltHost")
7073
){
7174
agent=createHttpAgent()
7275
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp