Not logged in. · Lost password · Register
Forum: MatriX RSS
Possibility to write component and server with MatriX
Page: previous  1  2 
Avatar
tambunanw #16
User title: Welly
Member since Jul 2011 · 57 posts · Location: Jakarta
Group memberships: Members, Premium
Show profile · Link to this post
In reply to post ID 6509
hi Alex,

Has MatriX library already support writing the SASL and TLS module in server ? Or do you have that kind of library to handle it ?
Avatar
Alex #17
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
All you need for TLS on the TCP layer is in the .NET Framework in the SslStream class:
http://msdn.microsoft.com/en-us/library/system.net.securit…
All XMPP packets you need of this are present.

For SASL all XMPP packets are present as well. Depending on which SASL mechanism you want to use so have to implement the server side for challenge and response. But when you are on TLS then SASL Plain should be fine. If you need a more secure SASL mechanism I can give you access the SASL sources.

Alex
Avatar
tambunanw #18
User title: Welly
Member since Jul 2011 · 57 posts · Location: Jakarta
Group memberships: Members, Premium
Show profile · Link to this post
i've tried the sample code from your link with my created cert key. but i've got the following error while authenticating as server.

"The server mode SSL must use a certificate with the associated private key"

I've already tried the solution on the internet but still return that error
Avatar
tambunanw #19
User title: Welly
Member since Jul 2011 · 57 posts · Location: Jakarta
Group memberships: Members, Premium
Show profile · Link to this post
this is my code..

  1.             else if (e.Stanza is StartTls)
  2.             {
  3.                 socketWriter.SendAsync(new Proceed());
  4.                 //Console.WriteLine(e.Stanza);
  5.                
  6.                 var stream = new SslStream(new NetworkStream(m_Sock), false, ValidateServerCertificate, ChooseClientCertificate);
  7.                 X509Certificate cert = new X509Certificate2(
  8.                             @"localhost-cert.p12",
  9.                             "test");
  10.  
  11.                 //X509Certificate cert = X509Certificate.CreateFromCertFile("jakwt.cer");
  12.                 stream.AuthenticateAsServer(cert, false, SslProtocols.Tls, false);
  13.                
  14.             }

could you please tell me what's wrong with that ?
Avatar
Alex #20
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Your certificate does not include a private key. You have to create a certificate with a private key.
I think this thread can help you:
http://stackoverflow.com/questions/695802/using-ssl-and-ss…
Avatar
tambunanw #21
User title: Welly
Member since Jul 2011 · 57 posts · Location: Jakarta
Group memberships: Members, Premium
Show profile · Link to this post
i've already tried that but it failed. could you give me the sample of pfx so i could try it ? to find out if the problem in my machine ?
Avatar
Alex #22
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I have attached a cert which works fine for me in my server projects. The password should be "secret" without the quotes.
The author has attached one file to this post:
localhost.pfx 1.6 kBytes
You have no permission to open this file.
Avatar
tambunanw #23
User title: Welly
Member since Jul 2011 · 57 posts · Location: Jakarta
Group memberships: Members, Premium
Show profile · Link to this post
Quote by Alex:
I have attached a cert which works fine for me in my server projects. The password should be "secret" without the quotes.

Thanks Alex, It works.

Thanks a lot
Avatar
tambunanw #24
User title: Welly
Member since Jul 2011 · 57 posts · Location: Jakarta
Group memberships: Members, Premium
Show profile · Link to this post
In reply to post #17
Quote by Alex:
f you need a more secure SASL mechanism I can give you access the SASL sources.

Alex, could you please give me access to SASL sources ?
Avatar
Alex #25
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by tambunanw:
Quote by Alex:
f you need a more secure SASL mechanism I can give you access the SASL sources.

Alex, could you please give me access to SASL sources ?

contact me directly by email please.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page: previous  1  2 
Forum: MatriX RSS