[Mono-dev] Can anyone explain this to me? It's the Bermuda triangle.

Edward Ned Harvey (mono) edward.harvey.mono at clevertrove.com
Tue Apr 22 14:49:55 UTC 2014


To answer questions:   

Yes, I have mozroots installed (as evidenced by the fact that the other server, with the exact same cert chain, validates without any problem.)  

I'm not aware of any other thread which could be throwing the exception - as seen in code below, there is only one thread, and it's not a background thread, so even if some other thread *does* die somehow, it shouldn't interfere with this one.

System.Console.Error flushes itself automatically. That's why I used it.  But I guess I can call Flush() explicitly, just to be sure.  (Even though I'm already sure.)

I'm not sure what a "cached console" is.  But yes, the reason I'm running the --trace on the code is because (a) something's going wrong, (b) I can't get Xamarin Studio to step into the code, (c) I followed the breadcrumbs down to this method, which is then calling its event handler, and I don't know what other thing is subscribed to the event handler.  So I wanted --trace to tell me.  But it doesn't seem to actually call the event handler...  It somehow magically throws exception checking if the handler is null or not.  Which baffles me.

Here is the complete application code I'm testing with:

using System;
using System.Net;
using System.Net.Sockets;
using System.Net.Security;
using System.Security.Authentication;
using System.Diagnostics;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;

namespace FunWithSslCerts
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            const string hostname = "telefolder.vgocom.net";    // works
            //const string hostname = "synctuary.clevertrove.net";  // causes AuthenticateAsClient to except, even though it shouldn't
            const int port = 443;

            var client = new TcpClient();
            client.Connect(hostname, port);
            var mySslStream = new SslStream(client.GetStream(), leaveInnerStreamOpen: false);
            mySslStream.AuthenticateAsClient(
                targetHost: hostname,
                clientCertificates: null, 
                enabledSslProtocols: SslProtocols.Tls, 
                checkCertificateRevocation: false
            );
            // If we throw exception on the line above, we failed.
            // If we get here, we were successful.
            System.Console.Error.WriteLine("NEDDEBUG Succeeded.");
        }
    }
}



More information about the Mono-devel-list mailing list