[Mono-dev] ClientCertificateValidation SSL in MONO

Petit Eric surfzoid at gmail.com
Wed Aug 13 10:18:24 EDT 2008

I forget the Mono web link, but the new method(who prevent "obsoloete"
warning seem to doesn't work yet, so i use the 1.0 one, in a static
class like this :
and it work

2008/8/13, Dominik <domi.w at gmx.de>:
> hi,
>  i'm trying to  connect with ssl as client but the callback function
>  never invoked and the server do not become any data... do you know why
>  its not working?
>  i'm using SSL3 / TLSv1
>  On the server side(Authenticate as server works fine but not as client)
>  it seems all must be correct... :(
>  here is my code in vb.net to authenticate as client:
>                            DataSSLStream = New
>  Mono.Security.Protocol.Tls.SslServerStream(DataSock.GetStream,
>  X509Certificate.CreateFromCertFile("/home/mono/ssl.cer"), True, False)
>                            DataSSLStream.PrivateKeyCertSelectionDelegate
>  = New PrivateKeySelectionCallback(AddressOf GetPrivateKey)
>                            DataSSLStream.ClientCertValidationDelegate =
>  New CertificateValidationCallback(AddressOf VerifyClientCertificate)
>        Private Function GetPrivateKey(ByVal certificate As
>  X509Certificate, ByVal targetHost As String) As AsymmetricAlgorithm
>            Dim key As PrivateKey =
>  PrivateKey.CreateFromFile("/home/mono/ssl.pvk", "password")
>            Return key.RSA
>        End Function 'GetPrivateKey
>        Private Function VerifyClientCertificate(ByVal certificate As
>  X509Certificate, ByVal certificateErrors() As Integer) As Boolean
>            If certificate IsNot Nothing Then
>                Console.WriteLine(certificate.ToString(True))
>            Else
>                Console.WriteLine("No client certificate provided.")
>            End If
>            Return True
>        End Function
>  I hope you can help me, thanks!!
> Dominik
>  _______________________________________________
>  Mono-devel-list mailing list
>  Mono-devel-list at lists.ximian.com
>  http://lists.ximian.com/mailman/listinfo/mono-devel-list



Small Eric Quotations of the days:
If one day one reproaches you that your work is not a work of
professional, say you that:
Amateurs built the arch of Noah, and professionals the Titanic.

Few people are done for independence, it is the privilege of the powerful ones.

No key was wounded during the drafting of this message.

More information about the Mono-devel-list mailing list