After changing Scripting Runtime Version to “Stable (.NET 4.x Equivalent)” there seems to be some incompatibilities with things that used to work before on the .NET Subset. Some are easy to workaround, but the missing TLS support seems problematic.
Here is the exception on Mac while building with “.NET Standard 2.0” Api Compatibility Level related to TLS:
NotSupportedException: Could not find TLS Provider: `Mono.AppleTls.AppleTlsProvider'. at Mono.Net.Security.MonoTlsProviderFactory.LookupProvider (System.String name, System.Boolean throwOnError) (at <29f77733112e45758bddddda41557ba4>:0) at Mono.Net.Security.MonoTlsProviderFactory.CreateDefaultProviderImpl () (at <29f77733112e45758bddddda41557ba4>:0) at Mono.Net.Security.MonoTlsProviderFactory.InitializeInternal () (at <29f77733112e45758bddddda41557ba4>:0) at Rethrow as NotSupportedException: TLS Support not available. at Mono.Net.Security.MonoTlsProviderFactory.InitializeInternal () (at <29f77733112e45758bddddda41557ba4>:0) at Mono.Net.Security.MonoTlsProviderFactory.GetProviderInternal () (at <29f77733112e45758bddddda41557ba4>:0) at Mono.Net.Security.MonoTlsProviderFactory.GetProvider () (at <29f77733112e45758bddddda41557ba4>:0) at Mono.Net.Security.NoReflectionHelper.GetProvider () (at <29f77733112e45758bddddda41557ba4>:0) at Mono.Security.Interface.MonoTlsProviderFactory.GetProvider () (at <7a3029b125ef46239232d401ab7fb89b>:0) at System.Net.Security.SslStream.GetProvider () (at <29f77733112e45758bddddda41557ba4>:0) at System.Net.Security.SslStream..ctor (System.IO.Stream innerStream, System.Boolean leaveInnerStreamOpen, System.Net.Security.RemoteCertificateValidationCallback userCertificateValidationCallback, System.Net.Security.LocalCertificateSelectionCallback userCertificateSelectionCallback) (at <29f77733112e45758bddddda41557ba4>:0) at (wrapper remoting-invoke-with-check) System.Net.Security.SslStream..ctor(System.IO.Stream,bool,System.Net.Security.RemoteCertificateValidationCallback,System.Net.Security.LocalCertificateSelectionCallback)
After changing the Api Compatibility Level to “.NET 4.x” this goes away on Mac so no big deal there.
Unfortunately even on Api Compatibility Level “.NET 4.x”, it seems to still be missing on Android:
E/Unity ( 8934): NotSupportedException: Could not find TLS Provider: `Mono.Net.Security.LegacyTlsProvider'. E/Unity ( 8934): at Mono.Net.Security.MonoTlsProviderFactory.LookupProvider (System.String name, System.Boolean throwOnError) [0x00000] in <00000000000000000000000000000000>:0 E/Unity ( 8934): at Mono.Net.Security.MonoTlsProviderFactory.InitializeInternal () [0x00000] in <00000000000000000000000000000000>:0 E/Unity ( 8934): at Mono.Net.Security.MonoTlsProviderFactory.GetProviderInternal () [0x00000] in <00000000000000000000000000000000>:0 E/Unity ( 8934): at Mono.Net.Security.MonoTlsProviderFactory.GetProvider () [0x00000] in <00000000000000000000000000000000>:0 E/Unity ( 8934): at Mono.Security.Interface.MonoTlsProviderFactory.GetProvider () [0x00000] in <00000000000000000000000000000000>:0 E/Unity ( 8934): at System.Net.Security.SslStream..ctor (System.IO.Stream innerStream, System.Boolean leaveInnerStreamOpen, System.Net.Security.RemoteCertificateValidationCallback userCertificateValidationCallback, System.Net.Security.LocalCertificateSelectionCallback userCertificateSelectionCallback) [0x00000] in
Of note the same code on Android, iOS, Mac and Windows has zero issues with TLS under .NET Subset on Unity 5.6. Does anyone know if this is something that is actively being worked on, never going to be added to the upgraded runtime, or something else entirely?