Code example for SSLContext

Methods: getSocketFactory

0
		@Override 
		public Socket createSocket(Socket socket, String host, int port, boolean autoClose)
				throws IOException, UnknownHostException { 
			return sslContext.getSocketFactory().createSocket(socket, host, port, autoClose);
		} 
 
		@Override 
		public Socket createSocket() throws IOException {
			return sslContext.getSocketFactory().createSocket();
		} 
	} 
 
	private static void paramToUpload(OutputStream baos, WeiboParameters params)
			throws WeiboException { 
		String key = "";
		for (int loc = 0; loc < params.size(); loc++) {
			key = params.getKey(loc);
			StringBuilder temp = new StringBuilder(10);
			temp.setLength(0);
			temp.append(MP_BOUNDARY).append("\r\n");
			temp.append("content-disposition: form-data; name=\"").append(key).append("\"\r\n\r\n");