|
|
@@ -92,7 +92,7 @@ func TestSimpleTLSConnection(t *testing.T) {
|
|
|
Receiver: &protocol.ServerEndpoint{
|
|
|
Address: net.NewIPOrDomain(net.LocalHostIP),
|
|
|
Port: uint32(serverPort),
|
|
|
- User: &protocol.User{
|
|
|
+ User: &protocol.User{
|
|
|
Account: serial.ToTypedMessage(&vmess.Account{
|
|
|
Id: userID.String(),
|
|
|
}),
|
|
|
@@ -203,7 +203,7 @@ func TestAutoIssuingCertificate(t *testing.T) {
|
|
|
Receiver: &protocol.ServerEndpoint{
|
|
|
Address: net.NewIPOrDomain(net.LocalHostIP),
|
|
|
Port: uint32(serverPort),
|
|
|
- User: &protocol.User{
|
|
|
+ User: &protocol.User{
|
|
|
Account: serial.ToTypedMessage(&vmess.Account{
|
|
|
Id: userID.String(),
|
|
|
}),
|
|
|
@@ -304,7 +304,7 @@ func TestTLSOverKCP(t *testing.T) {
|
|
|
Receiver: &protocol.ServerEndpoint{
|
|
|
Address: net.NewIPOrDomain(net.LocalHostIP),
|
|
|
Port: uint32(serverPort),
|
|
|
- User: &protocol.User{
|
|
|
+ User: &protocol.User{
|
|
|
Account: serial.ToTypedMessage(&vmess.Account{
|
|
|
Id: userID.String(),
|
|
|
}),
|
|
|
@@ -400,7 +400,7 @@ func TestTLSOverWebSocket(t *testing.T) {
|
|
|
Receiver: &protocol.ServerEndpoint{
|
|
|
Address: net.NewIPOrDomain(net.LocalHostIP),
|
|
|
Port: uint32(serverPort),
|
|
|
- User: &protocol.User{
|
|
|
+ User: &protocol.User{
|
|
|
Account: serial.ToTypedMessage(&vmess.Account{
|
|
|
Id: userID.String(),
|
|
|
}),
|
|
|
@@ -512,7 +512,7 @@ func TestGRPC(t *testing.T) {
|
|
|
Receiver: &protocol.ServerEndpoint{
|
|
|
Address: net.NewIPOrDomain(net.LocalHostIP),
|
|
|
Port: uint32(serverPort),
|
|
|
- User: &protocol.User{
|
|
|
+ User: &protocol.User{
|
|
|
Account: serial.ToTypedMessage(&vmess.Account{
|
|
|
Id: userID.String(),
|
|
|
}),
|
|
|
@@ -624,7 +624,7 @@ func TestGRPCMultiMode(t *testing.T) {
|
|
|
Receiver: &protocol.ServerEndpoint{
|
|
|
Address: net.NewIPOrDomain(net.LocalHostIP),
|
|
|
Port: uint32(serverPort),
|
|
|
- User: &protocol.User{
|
|
|
+ User: &protocol.User{
|
|
|
Account: serial.ToTypedMessage(&vmess.Account{
|
|
|
Id: userID.String(),
|
|
|
}),
|
|
|
@@ -674,7 +674,7 @@ func TestSimpleTLSConnectionPinned(t *testing.T) {
|
|
|
defer tcpServer.Close()
|
|
|
certificateDer := cert.MustGenerate(nil)
|
|
|
certificate := tls.ParseCertificate(certificateDer)
|
|
|
- certHash := tls.GenerateCertChainHash([][]byte{certificateDer.Certificate})
|
|
|
+ certHash := tls.GenerateCertHash(certificateDer.Certificate)
|
|
|
userID := protocol.NewID(uuid.New())
|
|
|
serverPort := tcp.PickPort()
|
|
|
serverConfig := &core.Config{
|
|
|
@@ -731,7 +731,7 @@ func TestSimpleTLSConnectionPinned(t *testing.T) {
|
|
|
Receiver: &protocol.ServerEndpoint{
|
|
|
Address: net.NewIPOrDomain(net.LocalHostIP),
|
|
|
Port: uint32(serverPort),
|
|
|
- User: &protocol.User{
|
|
|
+ User: &protocol.User{
|
|
|
Account: serial.ToTypedMessage(&vmess.Account{
|
|
|
Id: userID.String(),
|
|
|
}),
|
|
|
@@ -743,8 +743,8 @@ func TestSimpleTLSConnectionPinned(t *testing.T) {
|
|
|
SecurityType: serial.GetMessageType(&tls.Config{}),
|
|
|
SecuritySettings: []*serial.TypedMessage{
|
|
|
serial.ToTypedMessage(&tls.Config{
|
|
|
- AllowInsecure: true,
|
|
|
- PinnedPeerCertificateChainSha256: [][]byte{certHash},
|
|
|
+ AllowInsecure: true,
|
|
|
+ PinnedPeerCertificateSha256: [][]byte{certHash},
|
|
|
}),
|
|
|
},
|
|
|
},
|
|
|
@@ -771,7 +771,7 @@ func TestSimpleTLSConnectionPinnedWrongCert(t *testing.T) {
|
|
|
defer tcpServer.Close()
|
|
|
certificateDer := cert.MustGenerate(nil)
|
|
|
certificate := tls.ParseCertificate(certificateDer)
|
|
|
- certHash := tls.GenerateCertChainHash([][]byte{certificateDer.Certificate})
|
|
|
+ certHash := tls.GenerateCertHash(certificateDer.Certificate)
|
|
|
certHash[1] += 1
|
|
|
userID := protocol.NewID(uuid.New())
|
|
|
serverPort := tcp.PickPort()
|
|
|
@@ -829,7 +829,7 @@ func TestSimpleTLSConnectionPinnedWrongCert(t *testing.T) {
|
|
|
Receiver: &protocol.ServerEndpoint{
|
|
|
Address: net.NewIPOrDomain(net.LocalHostIP),
|
|
|
Port: uint32(serverPort),
|
|
|
- User: &protocol.User{
|
|
|
+ User: &protocol.User{
|
|
|
Account: serial.ToTypedMessage(&vmess.Account{
|
|
|
Id: userID.String(),
|
|
|
}),
|
|
|
@@ -841,8 +841,8 @@ func TestSimpleTLSConnectionPinnedWrongCert(t *testing.T) {
|
|
|
SecurityType: serial.GetMessageType(&tls.Config{}),
|
|
|
SecuritySettings: []*serial.TypedMessage{
|
|
|
serial.ToTypedMessage(&tls.Config{
|
|
|
- AllowInsecure: true,
|
|
|
- PinnedPeerCertificateChainSha256: [][]byte{certHash},
|
|
|
+ AllowInsecure: true,
|
|
|
+ PinnedPeerCertificateSha256: [][]byte{certHash},
|
|
|
}),
|
|
|
},
|
|
|
},
|
|
|
@@ -869,7 +869,7 @@ func TestUTLSConnectionPinned(t *testing.T) {
|
|
|
defer tcpServer.Close()
|
|
|
certificateDer := cert.MustGenerate(nil)
|
|
|
certificate := tls.ParseCertificate(certificateDer)
|
|
|
- certHash := tls.GenerateCertChainHash([][]byte{certificateDer.Certificate})
|
|
|
+ certHash := tls.GenerateCertHash(certificateDer.Certificate)
|
|
|
userID := protocol.NewID(uuid.New())
|
|
|
serverPort := tcp.PickPort()
|
|
|
serverConfig := &core.Config{
|
|
|
@@ -926,7 +926,7 @@ func TestUTLSConnectionPinned(t *testing.T) {
|
|
|
Receiver: &protocol.ServerEndpoint{
|
|
|
Address: net.NewIPOrDomain(net.LocalHostIP),
|
|
|
Port: uint32(serverPort),
|
|
|
- User: &protocol.User{
|
|
|
+ User: &protocol.User{
|
|
|
Account: serial.ToTypedMessage(&vmess.Account{
|
|
|
Id: userID.String(),
|
|
|
}),
|
|
|
@@ -938,9 +938,9 @@ func TestUTLSConnectionPinned(t *testing.T) {
|
|
|
SecurityType: serial.GetMessageType(&tls.Config{}),
|
|
|
SecuritySettings: []*serial.TypedMessage{
|
|
|
serial.ToTypedMessage(&tls.Config{
|
|
|
- Fingerprint: "random",
|
|
|
- AllowInsecure: true,
|
|
|
- PinnedPeerCertificateChainSha256: [][]byte{certHash},
|
|
|
+ Fingerprint: "random",
|
|
|
+ AllowInsecure: true,
|
|
|
+ PinnedPeerCertificateSha256: [][]byte{certHash},
|
|
|
}),
|
|
|
},
|
|
|
},
|
|
|
@@ -967,7 +967,7 @@ func TestUTLSConnectionPinnedWrongCert(t *testing.T) {
|
|
|
defer tcpServer.Close()
|
|
|
certificateDer := cert.MustGenerate(nil)
|
|
|
certificate := tls.ParseCertificate(certificateDer)
|
|
|
- certHash := tls.GenerateCertChainHash([][]byte{certificateDer.Certificate})
|
|
|
+ certHash := tls.GenerateCertHash(certificateDer.Certificate)
|
|
|
certHash[1] += 1
|
|
|
userID := protocol.NewID(uuid.New())
|
|
|
serverPort := tcp.PickPort()
|
|
|
@@ -1025,7 +1025,7 @@ func TestUTLSConnectionPinnedWrongCert(t *testing.T) {
|
|
|
Receiver: &protocol.ServerEndpoint{
|
|
|
Address: net.NewIPOrDomain(net.LocalHostIP),
|
|
|
Port: uint32(serverPort),
|
|
|
- User: &protocol.User{
|
|
|
+ User: &protocol.User{
|
|
|
Account: serial.ToTypedMessage(&vmess.Account{
|
|
|
Id: userID.String(),
|
|
|
}),
|
|
|
@@ -1037,9 +1037,9 @@ func TestUTLSConnectionPinnedWrongCert(t *testing.T) {
|
|
|
SecurityType: serial.GetMessageType(&tls.Config{}),
|
|
|
SecuritySettings: []*serial.TypedMessage{
|
|
|
serial.ToTypedMessage(&tls.Config{
|
|
|
- Fingerprint: "random",
|
|
|
- AllowInsecure: true,
|
|
|
- PinnedPeerCertificateChainSha256: [][]byte{certHash},
|
|
|
+ Fingerprint: "random",
|
|
|
+ AllowInsecure: true,
|
|
|
+ PinnedPeerCertificateSha256: [][]byte{certHash},
|
|
|
}),
|
|
|
},
|
|
|
},
|