[Mono-list] SslStream

Peter Bradley p.bradley at dsl.pipex.com
Tue Jun 17 12:40:56 EDT 2008


Ysgrifennodd Atsushi Eno:
> Where do you get NotImplementedException? The stack trace would help.
>
> I have implemented SslStream some months or years ago and now
> there is no code that throws NIE in SslStream itself.
>
> Atsushi Eno

Hi Atsushi,

First, many thanks for your quick reply.  Here is the stack trace, some 
lines from the offending assembly and the response from mono --version 
(it's 1.2.5, which is the latest for openSUSE 10.3 in the standard 
repositories):

-------------->> Stack Trace <<----------------

peter at linux:/home/peter/VS2008Projects/EPP.NET/EppClientConsoleUI/bin/Debug> 
mono EppClientConsoleUI.exe

** (EppClientConsoleUI.exe:5119): WARNING **: : mprotect failed: 
Permission denied

** (EppClientConsoleUI.exe:5119): WARNING **: : mprotect failed: 
Permission denied

** (EppClientConsoleUI.exe:5119): WARNING **: : mprotect failed: 
Permission denied

** (EppClientConsoleUI.exe:5119): WARNING **: : mprotect failed: 
Permission denied
Please enter your user id : H110172
Please enter your password: *******

Unhandled Exception: System.NotImplementedException: The requested 
feature is not implemented.
  at System.Net.Security.SslStream.AuthenticateAsClient (System.String 
targetHost, 
System.Security.Cryptography.X509Certificates.X509CertificateCollection 
clientCertificates, SslProtocols sslProtocolType, Boolean 
checkCertificateRevocation) [0x00000]
  at uk.co.special.Epp.EppClient.Connect (System.String uid, 
System.String pwd) [0x00000]
  at uk.co.special.Epp.EppClientConsoleUI.Run () [0x00000]
  at uk.co.special.Epp.EppClientConsoleUI.Main (System.String[] args) 
[0x00000]
peter at linux:/home/peter/VS2008Projects/EPP.NET/EppClientConsoleUI/bin/Debug>

----------------->>> The code (with context) from EppClient.Connect() 
<<<-----------------

            try
            {
                client = new TcpClient(serverName, portNumber);

                SslStream sslStream = new SslStream(client.GetStream(),
                                                    false,
                                                    new 
RemoteCertificateValidationCallback(CertificateValidationCallback),
                                                    null);

                sslStream.AuthenticateAsClient(serverName,
                                                certificates,
                                                SslProtocols.Default,
                                                false);
                return ReadGreeting(sslStream);
            }
            catch (ArgumentNullException ane)
            {
                throw new EppException( "Server name or SslStream inner 
stream " +
                                        " is a null reference. " +
                                        "\nException message is: " +
                                        ane.Message);
            }
            catch (ArgumentOutOfRangeException aoore)
            {
                throw new EppException( "Port number is not between 
MinPort and MaxPort. " +
                                        "\nException message is: " +
                                        aoore.Message);
            }
            catch (SocketException se)
            {
                throw new EppException( "An error occurred when 
accessing the socket. " +
                                        "See the Remarks section for 
more information. " +
                                        "\nExceptions message is: " +
                                        se.Message);
            }
            catch (ArgumentException ae)
            {
                throw new EppException( "Inner SslStream stream is 
either not readable " +
                                        "or not writable." +
                                        "\nException message is: " +
                                        ae.Message);
            }

----------------------------->>> mono version <<<-----------------

peter at linux:/home/peter/VS2008Projects/EPP.NET/EppClientConsoleUI/bin/Debug> 
mono --version
Mono JIT compiler version 1.2.5 (tarball)
Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       normal
        Architecture:  amd64
        Disabled:      none
peter at linux:/home/peter/VS2008Projects/EPP.NET/EppClientConsoleUI/bin/Debug>

-------------------------------->>><<<------------------------------------

Again, many thanks.  I hope the output above will shed some light on things.

Thanks


Peter



More information about the Mono-list mailing list