Code example for HttpsURLConnection

Methods: setHostnameVerifier

0
 
		if (url.getProtocol().toLowerCase().equals("https")) {
			trustAllHosts(); 
			HttpsURLConnection https = (HttpsURLConnection) url
					.openConnection();
			https.setHostnameVerifier(DO_NOT_VERIFY);
			http = https;
		} else { 
			http = (HttpURLConnection) url.openConnection();
		} 
 
		return http;
	} 
 
	/** 
	 * URL�����񂩂�Http�ڑ����擾���܂� 
	 */ 
	private HttpURLConnection connect(String u) {
		try { 
			return connect(new URL(u));
Experience pair programming with AI  Get Codota for Java