change socks5 client to provide userpass auth method only if auth configured
This commit is contained in:
1 parent
1f08b7cccd
commit
d76ded14f2
1 file changed
+3
-1
@@ -46,12 +46,14 @@ func (c *socks5Connector) Init(md md.Metadata) (err error) {
|
||||
selector := &clientSelector{
|
||||
methods: []uint8{
|
||||
gosocks5.MethodNoAuth,
|
||||
gosocks5.MethodUserPass,
|
||||
},
|
||||
User: c.options.Auth,
|
||||
TLSConfig: c.options.TLSConfig,
|
||||
logger: c.options.Logger,
|
||||
}
|
||||
if selector.User != nil {
|
||||
selector.methods = append(selector.methods, gosocks5.MethodUserPass)
|
||||
}
|
||||
if !c.md.noTLS {
|
||||
selector.methods = append(selector.methods, socks.MethodTLS)
|
||||
if selector.TLSConfig == nil {
|
||||
|
||||
Reference in new issue
Block a user