Golang crypto/x509.CertificateInvalidError() function example
package crypto/x509
CertificateInvalidError results when an odd error occurs. Users of this library probably want to handle all these errors uniformly.
Golang crypto/x509.CertificateInvalidError() function usage example
if hostError != nil {
switch errorType := hostError.(type) {
case x509.UnknownAuthorityError:
fmt.Println("unknown authority error")
case x509.HostnameError:
fmt.Println("hostname error")
case x509.CertificateInvalidError:
fmt.Println("invalid certificate error")
}
}
Reference :
Advertisement
Something interesting
Tutorials
+10.2k Golang : Random Rune generator
+11.1k Golang : Web routing/multiplex example
+8.9k Golang : Find network service name from given port and protocol
+4.7k Fix Google Analytics Redundant Hostnames problem
+5.4k Python : Delay with time.sleep() function example
+40.1k Golang : UDP client server read write example
+8.3k Golang : Configure Apache and NGINX to access your Go service example
+10k Golang : Setting variable value with ldflags
+7.7k Golang : Mapping Iban to Dunging alphabets
+5.9k Golang : Detect variable or constant type
+8.6k Golang : Convert(cast) []byte to io.Reader type
+5.7k Linux/Unix/PHP : Restart PHP-FPM