[Mono-dev] ClientCertificateValidation SSL in MONO
Petit Eric
surfzoid at gmail.com
Thu Aug 14 06:39:39 EDT 2008
2008/8/13 Krzys <krzys at inexos.net>:
> Hello,
>
> Just to let you know of a probable typo from the link you provided:
> http://monoosc.svn.sourceforge.net/viewvc/monoosc/MonoOSC/MonoOSCFramework/Class/VarGlobal.cs?revision=20&view=markup
>
> 62 public static bool TrustIt = AllaysTrustCertif();
>
> 76 static bool AllaysTrustCertif()
>
> Shouldn't this be AllwaysTrustCertif() ?
I'm not sure to understand my error, you mean :
"public static bool TrustIt = AllaysTrustCertif();
static bool "
Is unless ?
>
> Regards,
>
> Krzys.
>
> Petit Eric wrote:
>
> 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 :
> http://monoosc.svn.sourceforge.net/viewvc/monoosc/MonoOSC/MonoOSCFramework/Class/VarGlobal.cs?revision=20&view=markup
> 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
>
>
>
>
>
--
Cordially.
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