[System] xamarin_start_wwan is not available for tvOS and watchOS.
[mono.git] / mcs / class / System / System.Net / WebConnection.cs
index dd3cb0733480af3a97ea6b6351e36a55fbf19960..8c1523ad82484bb59a94c69298e2e3337a0b2c98 100644 (file)
@@ -82,13 +82,11 @@ namespace System.Net
                NtlmAuthState connect_ntlm_auth_state;
                HttpWebRequest connect_request;
 
-               bool ssl;
                Exception connect_exception;
                static object classLock = new object ();
-               IMonoTlsProvider tlsProvider;
                MonoTlsStream tlsStream;
 
-#if MONOTOUCH
+#if MONOTOUCH && !MONOTOUCH_TV && !MONOTOUCH_WATCH
                [System.Runtime.InteropServices.DllImport ("__Internal")]
                static extern void xamarin_start_wwan (string uri);
 #endif
@@ -154,7 +152,7 @@ namespace System.Net
                                IPHostEntry hostEntry = sPoint.HostEntry;
 
                                if (hostEntry == null) {
-#if MONOTOUCH
+#if MONOTOUCH && !MONOTOUCH_TV && !MONOTOUCH_WATCH
                                        xamarin_start_wwan (sPoint.Address.ToString ());
                                        hostEntry = sPoint.HostEntry;
                                        if (hostEntry == null) {
@@ -162,7 +160,7 @@ namespace System.Net
                                                status = sPoint.UsesProxy ? WebExceptionStatus.ProxyNameResolutionFailure :
                                                                            WebExceptionStatus.NameResolutionFailure;
                                                return;
-#if MONOTOUCH
+#if MONOTOUCH && !MONOTOUCH_TV && !MONOTOUCH_WATCH
                                        }
 #endif
                                }
@@ -221,15 +219,6 @@ namespace System.Net
                        }
                }
 
-               void EnsureSSLStreamAvailable (HttpWebRequest request)
-               {
-                       tlsProvider = request.TlsProvider;
-                       if (tlsProvider != null)
-                               return;
-
-                       tlsProvider = MonoTlsProviderFactory.GetProviderInternal ();
-               }
-
                bool CreateTunnel (HttpWebRequest request, Uri connectUri,
                                   Stream stream, out byte[] buffer)
                {
@@ -405,8 +394,6 @@ namespace System.Net
 
                                if (request.Address.Scheme == Uri.UriSchemeHttps) {
 #if SECURITY_DEP
-                                       ssl = true;
-                                       EnsureSSLStreamAvailable (request);
                                        if (!reused || nstream == null || tlsStream == null) {
                                                byte [] buffer = null;
                                                if (sPoint.UseConnect) {
@@ -425,7 +412,6 @@ namespace System.Net
                                        throw new NotSupportedException ();
 #endif
                                } else {
-                                       ssl = false;
                                        nstream = serverStream;
                                }
                        } catch (Exception ex) {