mirror of
https://github.com/jpillora/chisel
synced 2026-06-08 15:07:02 +00:00
Set ServerName (SNI) to *hostname. Useful for spoofing our way through restrictive gateways.
This commit is contained in:
@@ -50,6 +50,7 @@ type TLSConfig struct {
|
||||
CA string
|
||||
Cert string
|
||||
Key string
|
||||
ServerName string
|
||||
}
|
||||
|
||||
//Client represents a client instance
|
||||
@@ -107,6 +108,9 @@ func NewClient(c *Config) (*Client, error) {
|
||||
//configure tls
|
||||
if u.Scheme == "wss" {
|
||||
tc := &tls.Config{}
|
||||
if c.TLS.ServerName != "" {
|
||||
tc.ServerName = c.TLS.ServerName
|
||||
}
|
||||
//certificate verification config
|
||||
if c.TLS.SkipVerify {
|
||||
client.Infof("TLS verification disabled")
|
||||
|
||||
@@ -39,7 +39,7 @@ func (c *Client) connectionLoop(ctx context.Context) error {
|
||||
if attempt > 0 {
|
||||
maxAttemptVal := fmt.Sprint(maxAttempt)
|
||||
if maxAttempt < 0 {
|
||||
maxAttemptVal = "unlimited";
|
||||
maxAttemptVal = "unlimited"
|
||||
}
|
||||
msg += fmt.Sprintf(" (Attempt: %d/%s)", attempt, maxAttemptVal)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user