TLS 1.2 support

EthanMEthanM USMember

Hi,

I'm trying to run tlstest with TLS v1.2, but I'm getting the following error:

$  mcs tlstest.cs /r:System.dll /r:Mono.Security
tlstest.cs(175,23): warning CS0618: `System.Net.ServicePointManager.CertificatePolicy' is obsolete: `Use ServerCertificateValidationCallback instead'
tlstest.cs(216,26): warning CS0618: `System.Net.Dns.Resolve(string)' is obsolete: `Use GetHostEntry instead'
tlstest.cs(182,11): warning CS0219: The variable `prefix' is assigned but its value is never used
Compilation succeeded - 3 warning(s)

$ mono --debug tlstest.exe --tls12 https://www.google.com

https://www.google.com
FAILED: #-2146232800
System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: Error while sending TLS Alert (Fatal:InternalError): System.NotSupportedException: Unsupported security protocol type
  at Mono.Security.Protocol.Tls.Context.get_SecurityProtocol () [0x00045] in C:\j\workspace\v\repos\mono\mcs\class\Mono.Security\Mono.Security.Protocol.Tls\Context.cs:144
  at Mono.Security.Protocol.Tls.SslClientStream.BeginNegotiateHandshake (System.AsyncCallback callback, System.Object state) [0x0001b] in C:\j\workspace\v\repos\mono\mcs\class\Mono.Security\Mono.Security.Protocol.Tls\SslClientStream.cs:403
  at Mono.Security.Protocol.Tls.SslStreamBase.BeginNegotiateHandshake (Mono.Security.Protocol.Tls.InternalAsyncResult asyncResult) [0x00021] in C:\j\workspace\v\repos\mono\mcs\class\Mono.Security\Mono.Security.Protocol.Tls\SslStreamBase.cs:488  ---> System.NotSupportedException: Unsupported security protocol type
  at Mono.Security.Protocol.Tls.Context.get_SecurityProtocol () [0x00045] in C:\j\workspace\v\repos\mono\mcs\class\Mono.Security\Mono.Security.Protocol.Tls\Context.cs:144
  at Mono.Security.Protocol.Tls.SslClientStream.BeginNegotiateHandshake (System.AsyncCallback callback, System.Object state) [0x0001b] in C:\j\workspace\v\repos\mono\mcs\class\Mono.Security\Mono.Security.Protocol.Tls\SslClientStream.cs:403
  at Mono.Security.Protocol.Tls.SslStreamBase.BeginNegotiateHandshake (Mono.Security.Protocol.Tls.InternalAsyncResult asyncResult) [0x00021] in C:\j\workspace\v\repos\mono\mcs\class\Mono.Security\Mono.Security.Protocol.Tls\SslStreamBase.cs:488
  --- End of inner exception stack trace ---
  --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslStreamBase.BeginNegotiateHandshake (Mono.Security.Protocol.Tls.InternalAsyncResult asyncResult) [0x00067] in C:\j\workspace\v\repos\mono\mcs\class\Mono.Security\Mono.Security.Protocol.Tls\SslStreamBase.cs:503
  at Mono.Security.Protocol.Tls.SslStreamBase.NegotiateHandshake () [0x00018] in C:\j\workspace\v\repos\mono\mcs\class\Mono.Security\Mono.Security.Protocol.Tls\SslStreamBase.cs:160
  at Mono.Security.Protocol.Tls.SslStreamBase.Write (System.Byte[] buffer, Int32 offset, Int32 count) [0x00076] in C:\j\workspace\v\repos\mono\mcs\class\Mono.Security\Mono.Security.Protocol.Tls\SslStreamBase.cs:1111
  at System.IO.StreamWriter.Flush (Boolean flushStream, Boolean flushEncoder) [0x00094] in C:\j\workspace\v\repos\mono\external\referencesource\mscorlib\system\io\streamwriter.cs:329
  at System.IO.StreamWriter.Flush () [0x00006] in C:\j\workspace\v\repos\mono\external\referencesource\mscorlib\system\io\streamwriter.cs:303
  at TlsTest.GetStreamPage (System.String url) <0x3a2af88 + 0x002c2> in <filename unknown>:0
  at TlsTest.Main (System.String[] args) <0x39e1378 + 0x00583> in <filename unknown>:0

$  mcs --version
Mono C# compiler version 4.2.1.0
$ mono --version
Mono JIT compiler version 4.2.1 (Visual Studio built mono)

I've built this mono-tls branch, and copied Mono.Security.dll and System.dll into my working directory.

Any ideas?

-Ethan

Tagged:

Answers

  • VlahakisVlahakis GRMember

    Same here with latest mcs and mono:

    $  mcs --version
    Mono C# compiler version 4.8.0.0
    $ mono --version
    Mono JIT compiler version 4.8.0 (mono-4.8.0-branch/f5fbc32 Mon Nov 14 14:10:00 EST 2016)
    Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  x86
    Disabled:      none
    Misc:          softdebug 
    LLVM:          yes(3.6.0svn-mono-master/8b1520c)
    GC:            sgen
    
Sign In or Register to comment.