Xojo Plugin
Xojo Plugin
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 Xojo Plugin Downloads
Dim success As Boolean
success = False
Dim socket As New Chilkat.Socket
// Connect to the server using TLS.
Dim bTls As Boolean
bTls = True
Dim maxWaitMs As Int32
maxWaitMs = 5000
success = socket.Connect("example.com",5000,bTls,maxWaitMs)
If (success = False) Then
System.DebugLog(socket.LastErrorText)
Return
End If
// After connecting to a server that requests a client certificate, enumerate the certificate-
// authority distinguished names the server advertised as acceptable.
Dim numCAs As Int32
numCAs = socket.NumSslAcceptableClientCAs
Dim i As Int32
For i = 0 To numCAs - 1
Dim caDn As String
caDn = socket.GetSslAcceptableClientCaDn(i)
If (socket.LastMethodSuccess = False) Then
System.DebugLog(socket.LastErrorText)
Return
End If
System.DebugLog(caDn)
Next