Skip to content

Commit 2549281

Browse files
authored
Update x with main module v0.0.20 (#433)
1 parent a1a7bff commit 2549281

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

x/configurl/tls.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func parseOptions(configURL url.URL) ([]tls.ClientOption, error) {
5656
if len(values) != 1 {
5757
return nil, fmt.Errorf("certName option must has one value, found %v", len(values))
5858
}
59-
options = append(options, tls.WithCertificateName(values[0]))
59+
options = append(options, tls.WithCertVerifier(&tls.StandardCertVerifier{CertificateName: values[0]}))
6060
default:
6161
return nil, fmt.Errorf("unsupported option %v", key)
6262

x/configurl/tls_test.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,27 @@ func TestTLS_SNI(t *testing.T) {
2626
require.NoError(t, err)
2727
options, err := parseOptions(config.URL)
2828
require.NoError(t, err)
29-
cfg := tls.ClientConfig{ServerName: "host", CertificateName: "host"}
29+
certVerifier := &tls.StandardCertVerifier{CertificateName: "host"}
30+
cfg := tls.ClientConfig{ServerName: "host", CertVerifier: certVerifier}
3031
for _, option := range options {
3132
option("host", &cfg)
3233
}
3334
require.Equal(t, "www.google.com", cfg.ServerName)
34-
require.Equal(t, "host", cfg.CertificateName)
35+
require.Equal(t, certVerifier, cfg.CertVerifier)
3536
}
3637

3738
func TestTLS_NoSNI(t *testing.T) {
3839
config, err := ParseConfig("tls:sni=")
3940
require.NoError(t, err)
4041
options, err := parseOptions(config.URL)
4142
require.NoError(t, err)
42-
cfg := tls.ClientConfig{ServerName: "host", CertificateName: "host"}
43+
certVerifier := &tls.StandardCertVerifier{CertificateName: "host"}
44+
cfg := tls.ClientConfig{ServerName: "host", CertVerifier: certVerifier}
4345
for _, option := range options {
4446
option("host", &cfg)
4547
}
4648
require.Equal(t, "", cfg.ServerName)
47-
require.Equal(t, "host", cfg.CertificateName)
49+
require.Equal(t, certVerifier, cfg.CertVerifier)
4850
}
4951

5052
func TestTLS_MultipleSNI(t *testing.T) {
@@ -59,25 +61,25 @@ func TestTLS_CertName(t *testing.T) {
5961
require.NoError(t, err)
6062
options, err := parseOptions(config.URL)
6163
require.NoError(t, err)
62-
cfg := tls.ClientConfig{ServerName: "host", CertificateName: "host"}
64+
cfg := tls.ClientConfig{ServerName: "host", CertVerifier: &tls.StandardCertVerifier{CertificateName: "host"}}
6365
for _, option := range options {
6466
option("host", &cfg)
6567
}
6668
require.Equal(t, "host", cfg.ServerName)
67-
require.Equal(t, "www.google.com", cfg.CertificateName)
69+
require.Equal(t, "www.google.com", cfg.CertVerifier.(*tls.StandardCertVerifier).CertificateName)
6870
}
6971

7072
func TestTLS_Combined(t *testing.T) {
7173
config, err := ParseConfig("tls:SNI=sni.example.com&CertName=certname.example.com")
7274
require.NoError(t, err)
7375
options, err := parseOptions(config.URL)
7476
require.NoError(t, err)
75-
cfg := tls.ClientConfig{ServerName: "host", CertificateName: "host"}
77+
cfg := tls.ClientConfig{ServerName: "host", CertVerifier: &tls.StandardCertVerifier{CertificateName: "host"}}
7678
for _, option := range options {
7779
option("host", &cfg)
7880
}
7981
require.Equal(t, "sni.example.com", cfg.ServerName)
80-
require.Equal(t, "certname.example.com", cfg.CertificateName)
82+
require.Equal(t, "certname.example.com", cfg.CertVerifier.(*tls.StandardCertVerifier).CertificateName)
8183
}
8284

8385
func TestTLS_UnsupportedOption(t *testing.T) {

x/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ module github.com/Jigsaw-Code/outline-sdk/x
33
go 1.23.0
44

55
require (
6-
github.com/Jigsaw-Code/outline-sdk v0.0.19
6+
github.com/Jigsaw-Code/outline-sdk v0.0.20
77
// Use github.com/Psiphon-Labs/psiphon-tunnel-core@staging-client as per
88
// https://github.com/Psiphon-Labs/psiphon-tunnel-core/?tab=readme-ov-file#using-psiphon-with-go-modules
99
github.com/Psiphon-Labs/psiphon-tunnel-core v1.0.11-0.20250319154633-ceb78316d06e
10-
github.com/goccy/go-yaml v1.16.0
10+
github.com/goccy/go-yaml v1.17.1
1111
github.com/gorilla/websocket v1.5.3
12-
github.com/lmittmann/tint v1.0.5
12+
github.com/lmittmann/tint v1.0.7
1313
github.com/quic-go/quic-go v0.48.1
1414
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8
1515
github.com/stretchr/testify v1.9.0

x/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIo
88
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
99
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
1010
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
11-
github.com/Jigsaw-Code/outline-sdk v0.0.19 h1:/OpMz+3B/9ypjq/UyEvwZSflzJ4jXFginUOZeN0UssM=
12-
github.com/Jigsaw-Code/outline-sdk v0.0.19/go.mod h1:CFDKyGZA4zatKE4vMLe8TyQpZCyINOeRFbMAmYHxodw=
11+
github.com/Jigsaw-Code/outline-sdk v0.0.20 h1:4ep7MK9lFmcyPIRIbn4xrP1VKdJNsqR6+iJEOHDKnNg=
12+
github.com/Jigsaw-Code/outline-sdk v0.0.20/go.mod h1:CFDKyGZA4zatKE4vMLe8TyQpZCyINOeRFbMAmYHxodw=
1313
github.com/Jigsaw-Code/outline-ss-server v1.8.0 h1:6h7CZsyl1vQLz3nvxmL9FbhDug4QxJ1YTxm534eye1E=
1414
github.com/Jigsaw-Code/outline-ss-server v1.8.0/go.mod h1:slnHH3OZsQmZx/DRKhxvvaGE/8+n3Lkd6363h1ev71E=
1515
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
@@ -100,8 +100,8 @@ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEe
100100
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
101101
github.com/gobwas/glob v0.2.4-0.20180402141543-f00a7392b439 h1:T6zlOdzrYuHf6HUKujm9bzkzbZ5Iv/xf6rs8BHZDpoI=
102102
github.com/gobwas/glob v0.2.4-0.20180402141543-f00a7392b439/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
103-
github.com/goccy/go-yaml v1.16.0 h1:d7m1G7A0t+logajVtklHfDYJs2Et9g3gHwdBNNFou0w=
104-
github.com/goccy/go-yaml v1.16.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
103+
github.com/goccy/go-yaml v1.17.1 h1:LI34wktB2xEE3ONG/2Ar54+/HJVBriAGJ55PHls4YuY=
104+
github.com/goccy/go-yaml v1.17.1/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
105105
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
106106
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
107107
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -141,8 +141,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
141141
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
142142
github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s=
143143
github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU=
144-
github.com/lmittmann/tint v1.0.5 h1:NQclAutOfYsqs2F1Lenue6OoWCajs5wJcP3DfWVpePw=
145-
github.com/lmittmann/tint v1.0.5/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=
144+
github.com/lmittmann/tint v1.0.7 h1:D/0OqWZ0YOGZ6AyC+5Y2kD8PBEzBk6rFHVSfOqCkF9Y=
145+
github.com/lmittmann/tint v1.0.7/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=
146146
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
147147
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
148148
github.com/marusama/semaphore v0.0.0-20171214154724-565ffd8e868a h1:6SRny9FLB1eWasPyDUqBQnMi9NhXU01XIlB0ao89YoI=

0 commit comments

Comments
 (0)