title: Porting SSL application from Java to C#
body: <p>I'm porting a <a href="https://github.com/pcgod/mumble-android" rel="nofollow">java client</a> for <a href="http://mumble.sourceforge.net/" rel="nofollow">mumble</a> to C# and I've hit a bit of a brick wall.</p>
  
  <p>In java, the SSL socket is initiated like so:</p>
  
  <pre><code>final SSLContext ctx_ = SSLContext.getInstance("TLS");
  ctx_.init(null, new TrustManager[] { new LocalSSLTrustManager() }, null);
  final SSLSocketFactory factory = ctx_.getSocketFactory();
  final SSLSocket sslSocket = (SSLSocket) factory.createSocket(hostAddress, port);
  sslSocket.setUseClientMode(true);
  sslSocket.setEnabledProtocols(new String[] { "TLSv1" });
  sslSocket.startHandshake();
  </code></pre>
  
  <p>I've ported this to C# like this:</p>
  
  <pre><code>return ssl = new SslStream(netStream, false, (a, b, c, d) =&gt; true); //For now, accept any cert
  ssl.AuthenticateAsClient(serverName);
  </code></pre>
  
  <p>Now, this does actually establish a connection, but it's using AES128 and the <a href="https://github.com/mumble-voip/mumble/blob/master/doc/mumble-protocol.pdf" rel="nofollow">mumble protocol</a> requires AES256 so the server appears to then ignore anything I send on this socket.</p>
  
  <p>Is my code correctly ported? And is there a way to force C# to use AES256 for this connection?</p>