Classic ASP
Classic ASP
Enumerate Server-Advertised Acceptable Client CAs
See more Socket/SSL/TLS Examples
Demonstrates Socket.GetSslAcceptableClientCaDn, which returns a certificate-authority distinguished name advertised by a TLS server when it requests a client certificate.
Background. Valid indexes range from 0 through
NumSslAcceptableClientCAs minus one. A client can use these names to select an appropriate client certificate.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set socket = Server.CreateObject("Chilkat.Socket")
' Connect to the server using TLS.
bTls = 1
maxWaitMs = 5000
success = socket.Connect("example.com",5000,bTls,maxWaitMs)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( socket.LastErrorText) & "</pre>"
Response.End
End If
' After connecting to a server that requests a client certificate, enumerate the certificate-
' authority distinguished names the server advertised as acceptable.
numCAs = socket.NumSslAcceptableClientCAs
For i = 0 To numCAs - 1
caDn = socket.GetSslAcceptableClientCaDn(i)
If (socket.LastMethodSuccess = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( socket.LastErrorText) & "</pre>"
Response.End
End If
Response.Write "<pre>" & Server.HTMLEncode( caDn) & "</pre>"
Next
%>
</body>
</html>