Skip to content

Commit 2994856

Browse files
OS-kiranmalsettyip-rwdependabot[bot]Rajpratik71jpillora
authored andcommitted
Upstream sync (#14)
* Set ServerName (SNI) to *hostname. Useful for spoofing our way through restrictive gateways. * Bump actions/checkout from 2 to 3.1.0 Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.1.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v2...v3.1.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Added --sni switch to control the ServerName when connecting with TLS. Makes 'domain fronting' possible. * feat: dependabot workflow automation for updating dependency Signed-off-by: Pratik Raj <rajpratik71@gmail.com> * Bump github.com/fsnotify/fsnotify from 1.4.9 to 1.6.0 (jpillora#389) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * UDP buffer size override with CHISEL_UDP_MAX_SIZE environment variable (jpillora#367) * Add locking around the connection count to fix a data race. (jpillora#342) Co-authored-by: andres-portainer <andres-portainer@users.noreply.github.com> * fix: small typo error in main.go (jpillora#334) * Respond to /health and /version by request path rather than by the whole url string (jpillora#328) Co-authored-by: bar <foo@example.org> * Update version.go (jpillora#288) * Providing chisel's client with a logger level (jpillora#281) Co-authored-by: Barak Sharoni <barak.sharoni@velocity.tech> Co-authored-by: barak-sharoni-velocity <81081183+barak-sharoni-velocity@users.noreply.github.com> * add EnvBool * Fix jpillora#390: Use code to generate certificates for client & server (jpillora#400) * docker alpine->google-distroless * docker to use scratch * Fix missing NetDialContext: c.config.DialContext (jpillora#398) * actions: setup go v3 * switch to scratch image * update dependabot * move chisel to flyio * Bump to Go 1.21 (jpillora#440) Co-authored-by: cmeng <cmenginnz@gmail.com> * add arm v5 builds (jpillora#395) * Sync with upstream --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Pratik Raj <rajpratik71@gmail.com> Co-authored-by: ip-rw <s@ip.rw> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pratik Raj <Rajpratik71@gmail.com> Co-authored-by: Jaime Pillora <jpillora@gmail.com> Co-authored-by: fsiegmund <siegmund@slb.com> Co-authored-by: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Co-authored-by: andres-portainer <andres-portainer@users.noreply.github.com> Co-authored-by: 0xflotus <0xflotus@gmail.com> Co-authored-by: BigSully <BigSully@users.noreply.github.com> Co-authored-by: bar <foo@example.org> Co-authored-by: invist <35263248+c-f@users.noreply.github.com> Co-authored-by: zuzgon <zuzgon@gmail.com> Co-authored-by: Barak Sharoni <barak.sharoni@velocity.tech> Co-authored-by: barak-sharoni-velocity <81081183+barak-sharoni-velocity@users.noreply.github.com> Co-authored-by: Jaime Pillora <dev@jpillora.com> Co-authored-by: Guillaume SMAHA <GuillaumeSmaha@users.noreply.github.com> Co-authored-by: cmeng <cmenginnz@gmail.com> Co-authored-by: maurerr <maurerr@users.noreply.github.com>
1 parent 0b462c4 commit 2994856

File tree

6 files changed

+68
-96
lines changed

6 files changed

+68
-96
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Build & Test
1212
strategy:
1313
matrix:
14-
go-version: [1.19.x, 1.20.x]
14+
go-version: [1.21.x]
1515
platform: [ubuntu-latest, macos-latest, windows-latest]
1616
runs-on: ${{ matrix.platform }}
1717
steps:

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,7 @@ Since WebSockets support is required:
419419
- `1.6` - Added client stdio support (by @BoleynSu)
420420
- `1.7` - Added UDP support
421421
- `1.8` - Move to a `scratch`Docker image
422-
- `1.9` - Bump to Go 1.21. Switch from `--key` seed to P256 key strings with `--key{gen,file}` (by @cmenginnz)
423-
- `1.10` - Bump to Go 1.22. Add `.rpm` `.deb` and `.akp` to releases. Fix bad version comparison.
422+
- `1.9` - Switch from `--key` seed to P256 key strings with `--key{gen,file}` + bump to Go 1.21 (by @cmenginnz)
424423
425424
## License
426425

client/client_test.go

Lines changed: 48 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -44,81 +44,56 @@ func TestCustomHeaders(t *testing.T) {
4444
c.Close()
4545
}
4646

47-
// with the update Go to 1.20, these Unit Tests start failing,
48-
// since this test is related to client side, and the "fingerprint" flag is not available in cloud-connector
49-
// we can remove/comment these 3 Unit Tests, until fixed in upstream
50-
51-
// func TestFallbackLegacyFingerprint(t *testing.T) {
52-
// config := Config{
53-
// Fingerprint: "a5:32:92:c6:56:7a:9e:61:26:74:1b:81:a6:f5:1b:44",
54-
// }
55-
// c, err := NewClient(&config)
56-
// if err != nil {
57-
// t.Fatal(err)
58-
// }
59-
// r := ccrypto.NewDetermRand([]byte("test123"))
60-
// priv, err := ecdsa.GenerateKey(elliptic.P256(), r)
61-
// if err != nil {
62-
// t.Fatal(err)
63-
// }
64-
// pub, err := ssh.NewPublicKey(&priv.PublicKey)
65-
// if err != nil {
66-
// t.Fatal(err)
67-
// }
68-
// err = c.verifyServer("", nil, pub)
69-
// if err != nil {
70-
// t.Fatal(err)
71-
// }
72-
// }
73-
74-
// func TestVerifyLegacyFingerprint(t *testing.T) {
75-
// config := Config{
76-
// Fingerprint: "a5:32:92:c6:56:7a:9e:61:26:74:1b:81:a6:f5:1b:44",
77-
// }
78-
// c, err := NewClient(&config)
79-
// if err != nil {
80-
// t.Fatal(err)
81-
// }
82-
// r := ccrypto.NewDetermRand([]byte("test123"))
83-
// priv, err := ecdsa.GenerateKey(elliptic.P256(), r)
84-
// if err != nil {
85-
// t.Fatal(err)
86-
// }
87-
// pub, err := ssh.NewPublicKey(&priv.PublicKey)
88-
// if err != nil {
89-
// t.Fatal(err)
90-
// }
91-
// err = c.verifyLegacyFingerprint(pub)
92-
// if err != nil {
93-
// t.Fatal(err)
94-
// }
95-
// }
47+
func TestFallbackLegacyFingerprint(t *testing.T) {
48+
config := Config{
49+
Fingerprint: "a5:32:92:c6:56:7a:9e:61:26:74:1b:81:a6:f5:1b:44",
50+
}
51+
c, err := NewClient(&config)
52+
if err != nil {
53+
t.Fatal(err)
54+
}
55+
r := ccrypto.NewDetermRand([]byte("test123"))
56+
priv, err := ccrypto.GenerateKeyGo119(elliptic.P256(), r)
57+
if err != nil {
58+
t.Fatal(err)
59+
}
60+
pub, err := ssh.NewPublicKey(&priv.PublicKey)
61+
if err != nil {
62+
t.Fatal(err)
63+
}
64+
err = c.verifyServer("", nil, pub)
65+
if err != nil {
66+
t.Fatal(err)
67+
}
68+
}
9669

97-
// func TestVerifyFingerprint(t *testing.T) {
98-
// config := Config{
99-
// Fingerprint: "qmrRoo8MIqePv3jC8+wv49gU6uaFgD3FASQx9V8KdmY=",
100-
// }
101-
// c, err := NewClient(&config)
102-
// if err != nil {
103-
// t.Fatal(err)
104-
// }
105-
// r := ccrypto.NewDetermRand([]byte("test123"))
106-
// priv, err := ecdsa.GenerateKey(elliptic.P256(), r)
107-
// if err != nil {
108-
// t.Fatal(err)
109-
// }
110-
// pub, err := ssh.NewPublicKey(&priv.PublicKey)
111-
// if err != nil {
112-
// t.Fatal(err)
113-
// }
114-
// err = c.verifyServer("", nil, pub)
115-
// if err != nil {
116-
// t.Fatal(err)
117-
// }
118-
// }
70+
func TestVerifyLegacyFingerprint(t *testing.T) {
71+
config := Config{
72+
Fingerprint: "a5:32:92:c6:56:7a:9e:61:26:74:1b:81:a6:f5:1b:44",
73+
}
74+
c, err := NewClient(&config)
75+
if err != nil {
76+
t.Fatal(err)
77+
}
78+
r := ccrypto.NewDetermRand([]byte("test123"))
79+
priv, err := ccrypto.GenerateKeyGo119(elliptic.P256(), r)
80+
if err != nil {
81+
t.Fatal(err)
82+
}
83+
pub, err := ssh.NewPublicKey(&priv.PublicKey)
84+
if err != nil {
85+
t.Fatal(err)
86+
}
87+
err = c.verifyLegacyFingerprint(pub)
88+
if err != nil {
89+
t.Fatal(err)
90+
}
91+
}
11992

120-
func TestVerifyEmptyFingerprint(t *testing.T) {
121-
config := Config{}
93+
func TestVerifyFingerprint(t *testing.T) {
94+
config := Config{
95+
Fingerprint: "qmrRoo8MIqePv3jC8+wv49gU6uaFgD3FASQx9V8KdmY=",
96+
}
12297
c, err := NewClient(&config)
12398
if err != nil {
12499
t.Fatal(err)

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/jpillora/chisel
22

3-
go 1.20
3+
go 1.21
44

55
require (
66
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
@@ -9,17 +9,17 @@ require (
99
github.com/jpillora/backoff v1.0.0
1010
github.com/jpillora/requestlog v1.0.0
1111
github.com/jpillora/sizestr v1.0.0
12-
golang.org/x/crypto v0.8.0
13-
golang.org/x/net v0.9.0
14-
golang.org/x/sync v0.1.0
12+
golang.org/x/crypto v0.12.0
13+
golang.org/x/net v0.14.0
14+
golang.org/x/sync v0.3.0
1515
)
1616

1717
require (
1818
github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 // indirect
1919
github.com/jpillora/ansi v1.0.3 // indirect
2020
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect
21-
golang.org/x/sys v0.7.0 // indirect
22-
golang.org/x/text v0.9.0 // indirect
21+
golang.org/x/sys v0.11.0 // indirect
22+
golang.org/x/text v0.12.0 // indirect
2323
)
2424

2525
replace github.com/jpillora/chisel => ../chisel

go.sum

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ github.com/jpillora/sizestr v1.0.0 h1:4tr0FLxs1Mtq3TnsLDV+GYUWG7Q26a6s+tV5Zfw2yg
1616
github.com/jpillora/sizestr v1.0.0/go.mod h1:bUhLv4ctkknatr6gR42qPxirmd5+ds1u7mzD+MZ33f0=
1717
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce h1:fb190+cK2Xz/dvi9Hv8eCYJYvIGUTN2/KLq1pT6CjEc=
1818
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4=
19-
golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
20-
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
21-
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
22-
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
23-
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
24-
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
19+
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
20+
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
21+
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
22+
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
23+
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
24+
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
2525
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
26-
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
27-
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
28-
golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ=
29-
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
30-
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
26+
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
27+
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
28+
golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
29+
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
30+
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
31+
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=

main.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,6 @@ func server(args []string) {
240240
} else if config.KeySeed == "" {
241241
config.KeySeed = settings.Env("KEY")
242242
}
243-
if config.Auth == "" {
244-
config.Auth = os.Getenv("AUTH")
245-
}
246243
s, err := chserver.NewServer(config)
247244
if err != nil {
248245
log.Fatal(err)

0 commit comments

Comments
 (0)