[System] Document the new API for SSL/TLS cipher suites control added in ServicePoint...
authorSebastien Pouliot <sebastien@xamarin.com>
Tue, 11 Mar 2014 15:25:03 +0000 (11:25 -0400)
committerSebastien Pouliot <sebastien@xamarin.com>
Tue, 11 Mar 2014 15:25:31 +0000 (11:25 -0400)
mcs/class/System/Documentation/en/System.Net/CipherSuitesCallback.xml
mcs/class/System/Documentation/en/System.Net/ServicePointManager.xml

index 9831fac80d933389cc856964f1c841b7bcec32c1..868d1d80fe2667cab500fc676a5adadb48d5dbf9 100644 (file)
     <ReturnType>System.Collections.Generic.IEnumerable&lt;System.String&gt;</ReturnType>
   </ReturnValue>
   <Docs>
-    <param name="protocol">To be added.</param>
-    <param name="allCiphers">To be added.</param>
-    <summary>To be added.</summary>
-    <returns>To be added.</returns>
-    <remarks>To be added.</remarks>
+    <param name="protocol">The SSL/TLS protocol version used for the connection.</param>
+    <param name="allCiphers">The ordered list of all supported cipher suites.</param>
+    <summary>You can provide your own code to filter/re-order the cipher suites to be
+               used for client and/or server side SSL/TLS support.</summary>
+    <returns>The ordered list of all cipher suites you wish to support.</returns>
+    <remarks>This type is only available in Mono and Xamarin products.</remarks>
   </Docs>
 </Type>
index 6038d387402e21eb9332da07f3bf1855d5bb35bd..ba60c1d24f4d906cc3daca760b015183a5ebc5d1 100644 (file)
@@ -92,9 +92,20 @@ instance. </para>
         <ReturnType>System.Net.CipherSuitesCallback</ReturnType>
       </ReturnValue>
       <Docs>
-        <summary>To be added.</summary>
-        <value>To be added.</value>
-        <remarks>To be added.</remarks>
+        <summary>You can filter and/or re-order the ciphers suites that will be sent to the
+                       SSL/TLS server by providing your own callback.</summary>
+           <value>Your custom delegate or null for the default behaviour.</value>
+        <remarks>This mechanism cannot be used to add new ciphers. Undefined ciphers will be ignored. 
+                       This API is only available in Mono and Xamarin products.</remarks>
+               <example>
+                       <para>The following example removes weak (export) ciphers from the list that will be offered to the server.</para>
+                       <code lang="C#">ServicePointManager.ClientCipherSuitesCallback += (SecurityProtocolType
+p, IEnumerable&lt;string&gt; allCiphers) => {
+            return from cipher in allCiphers where !cipher.Contains ("EXPORT")
+select cipher;
+        };
+                       </code>
+               </example>
       </Docs>
     </Member>
     <Member MemberName="DefaultConnectionLimit">
@@ -502,9 +513,22 @@ for it are freed.</para>
         <ReturnType>System.Net.CipherSuitesCallback</ReturnType>
       </ReturnValue>
       <Docs>
-        <summary>To be added.</summary>
-        <value>To be added.</value>
-        <remarks>To be added.</remarks>
+        <summary>You can filter and/or re-order the ciphers suites that the SSL/TLS server
+                       will accept from a client. The first match for a supported client cipher suite
+                       will be used (so the order is important).</summary>
+        <value>Your custom delegate or null for the default behaviour.</value>
+        <remarks>This mechanism cannot be used to add new ciphers. Undefined ciphers will be ignored. 
+                       This API is only available in Mono and Xamarin products.</remarks>
+               <example>
+                       <para>The following example let the server accept AES128 (prefered cipher) or AES256 (allowed cipher) but no other cipher suite.</para>
+                       <code lang="C#">ServicePointManager.ClientCipherSuitesCallback += (SecurityProtocolType
+p, IEnumerable&lt;string&gt; allCiphers) => {
+            string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
+            return new List&lt;string&gt; { prefix + "RSA_WITH_AES_128_CBC_SHA",
+prefix + "RSA_WITH_AES_256_CBC_SHA" };
+        };
+                       </code>
+               </example>
       </Docs>
     </Member>
     <Member MemberName="SetTcpKeepAlive">