Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for VerifyHostname (0.19 sec)

  1. src/crypto/tls/conn.go

    	return c.ocspResponse
    }
    
    // VerifyHostname checks that the peer certificate chain is valid for
    // connecting to host. If so, it returns nil; if not, it returns an error
    // describing the problem.
    func (c *Conn) VerifyHostname(host string) error {
    	c.handshakeMutex.Lock()
    	defer c.handshakeMutex.Unlock()
    	if !c.isClient {
    		return errors.New("tls: VerifyHostname called on TLS server connection")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 51.8K bytes
    - Viewed (0)
  2. src/crypto/tls/tls_test.go

    	testenv.MustHaveExternalNetwork(t)
    
    	c, err := Dial("tcp", "www.google.com:https", nil)
    	if err != nil {
    		t.Fatal(err)
    	}
    	if err := c.VerifyHostname("www.google.com"); err != nil {
    		t.Fatalf("verify www.google.com: %v", err)
    	}
    	if err := c.VerifyHostname("www.yahoo.com"); err == nil {
    		t.Fatalf("verify www.yahoo.com succeeded")
    	}
    
    	c, err = Dial("tcp", "www.google.com:https", &Config{InsecureSkipVerify: true})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 60.5K bytes
    - Viewed (0)
  3. src/crypto/tls/common.go

    	// certificate needs to be valid for it.
    	if chi.ServerName != "" {
    		x509Cert, err := c.leaf()
    		if err != nil {
    			return fmt.Errorf("failed to parse certificate: %w", err)
    		}
    		if err := x509Cert.VerifyHostname(chi.ServerName); err != nil {
    			return fmt.Errorf("certificate is not valid for requested server name: %w", err)
    		}
    	}
    
    	// supportsRSAFallback returns nil if the certificate and connection support
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:10:12 UTC 2024
    - 59.1K bytes
    - Viewed (0)
Back to top