Sample code for 30+ languages & platforms
Tcl

Example: Http.GetServerCert method

Demonstrates how to call the GetServerCert method.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set http [new_CkHttp]

set cert [new_CkCert]

set success [CkHttp_GetServerCert $http "chilkatsoft.com" 443 $cert]
if {$success == 0} then {
    puts [CkHttp_lastErrorText $http]
    delete_CkHttp $http
    delete_CkCert $cert
    exit
}

puts [CkCert_subjectDN $cert]
puts [CkCert_validToStr $cert]

# Output:

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

delete_CkHttp $http
delete_CkCert $cert