Sample code for 30+ languages & platforms
Go Requires Chilkat v11.0.0+

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat Go Downloads

Go
    success := false

    http := chilkat.NewHttp()
    cert := chilkat.NewCert()

    success = http.GetServerCert("chilkatsoft.com",443,cert)
    if success == false {
        fmt.Println(http.LastErrorText())
        http.DisposeHttp()
        cert.DisposeCert()
        return
    }

    fmt.Println(cert.SubjectDN())
    fmt.Println(cert.ValidToStr())

    //  Output:

    //  CN=*.chilkatsoft.com
    //  Wed, 10 Jun 2026 23:59:59 GMT

    http.DisposeHttp()
    cert.DisposeCert()