mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	Add and fix nilnil
This commit is contained in:
		
							parent
							
								
									668e958d3e
								
							
						
					
					
						commit
						0315f55fcd
					
				@ -45,7 +45,6 @@ linters:
 | 
			
		||||
    - goconst
 | 
			
		||||
    - exhaustive
 | 
			
		||||
    - varnamelen
 | 
			
		||||
    - nilnil
 | 
			
		||||
 | 
			
		||||
    # We might want to enable this, but it might be a lot of work
 | 
			
		||||
    - cyclop
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								app.go
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								app.go
									
									
									
									
									
								
							@ -588,6 +588,7 @@ func (h *Headscale) Serve() error {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (h *Headscale) getTLSSettings() (*tls.Config, error) {
 | 
			
		||||
	var err error
 | 
			
		||||
	if h.cfg.TLSLetsEncryptHostname != "" {
 | 
			
		||||
		if !strings.HasPrefix(h.cfg.ServerURL, "https://") {
 | 
			
		||||
			log.Warn().
 | 
			
		||||
@ -628,12 +629,11 @@ func (h *Headscale) getTLSSettings() (*tls.Config, error) {
 | 
			
		||||
			log.Warn().Msg("Listening without TLS but ServerURL does not start with http://")
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return nil, nil
 | 
			
		||||
		return nil, err
 | 
			
		||||
	} else {
 | 
			
		||||
		if !strings.HasPrefix(h.cfg.ServerURL, "https://") {
 | 
			
		||||
			log.Warn().Msg("Listening with TLS but ServerURL does not start with https://")
 | 
			
		||||
		}
 | 
			
		||||
		var err error
 | 
			
		||||
		tlsConfig := &tls.Config{}
 | 
			
		||||
		tlsConfig.ClientAuth = tls.RequireAnyClientCert
 | 
			
		||||
		tlsConfig.NextProtos = []string{"http/1.1"}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user