feat: Add more logging to CNAME resolution
This commit is contained in:
		
							parent
							
								
									f4d8b151ec
								
							
						
					
					
						commit
						cb40a0689b
					
				@ -73,9 +73,9 @@ func MakeTlsConfig(pagesDomain, cachePath string, cache *certificates.Certificat
 | 
			
		||||
				// Note: We do not check err here because err != nil
 | 
			
		||||
				// always implies that cname == "", which does not have
 | 
			
		||||
				// pagesDomain as a suffix.
 | 
			
		||||
				cname, _ = dns.LookupCNAME(info.ServerName)
 | 
			
		||||
				cname, err := dns.LookupCNAME(info.ServerName)
 | 
			
		||||
				if !strings.HasSuffix(cname, pagesDomain) {
 | 
			
		||||
					log.Warnf("Got ServerName for Domain %s that we're not responsible for", info.ServerName)
 | 
			
		||||
					log.Warnf("Got ServerName for Domain %s that we're not responsible for. CNAME '%s', err: %v", info.ServerName, cname, err)
 | 
			
		||||
					return cache.FallbackCertificate.TlsCertificate, nil
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user