Classic ASP
Classic ASP
Transition from Http.GetServerSslCert to Http.GetServerCert
See more HTTP Examples
Provides instructions for replacing deprecated GetServerSslCert method calls with GetServerCert.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set http = Server.CreateObject("Chilkat.Http")
domain = "chilkatsoft.com"
port = 443
' ------------------------------------------------------------------------
' The GetServerSslCert method is deprecated:
' cert1 is a Chilkat.Cert
Set cert1 = http.GetServerSslCert(domain,port)
If (http.LastMethodSuccess = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
Response.End
End If
Response.Write "<pre>" & Server.HTMLEncode( cert1.SubjectDN) & "</pre>"
' ------------------------------------------------------------------------
' Do the equivalent using GetServerCert.
' Your application creates a new, empty certificate object which is passed
' in the last argument and filled with the server certificate upon success.
set cert2 = Server.CreateObject("Chilkat.Cert")
success = http.GetServerCert(domain,port,cert2)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
Response.End
End If
Response.Write "<pre>" & Server.HTMLEncode( cert2.SubjectDN) & "</pre>"
%>
</body>
</html>