HttpProtocolParams.setVersion( params, HttpVersion.HTTP_1_1 );
HttpProtocolParams.setContentCharset( params, "utf-8" );
params.setBooleanParameter( "http.protocol.expect-continue", false );
SSLSocketFactory sslsocketfactory = SSLSocketFactory.getSocketFactory();
SSLSocket sslsocket = (SSLSocket)sslsocketfactory.createSocket( params );
sslsocket.connect( new InetSocketAddress( "localhost", 9999 ) );
OutputStream outputstream = sslsocket.getOutputStream();
OutputStreamWriter outputstreamwriter = new OutputStreamWriter( outputstream );