mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 00:42:24 -05:00 
			
		
		
		
	Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kim <grufwub@gmail.com>
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			339 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			339 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package websocket
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 	"crypto/tls"
 | |
| )
 | |
| 
 | |
| func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error {
 | |
| 	if err := tlsConn.HandshakeContext(ctx); err != nil {
 | |
| 		return err
 | |
| 	}
 | |
| 	if !cfg.InsecureSkipVerify {
 | |
| 		if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil {
 | |
| 			return err
 | |
| 		}
 | |
| 	}
 | |
| 	return nil
 | |
| }
 |