package com.dbs.mplus.fatima.framework.util.http;

import com.dbs.mplus.fatima.framework.util.MPlusLogUtil;
import com.dbs.mplus.fatima.framework.MPlusFrameworkConstants;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSession;

/**
 * 서버를 믿을 수 있도록 
 * @author hyeeun 
 *
 */
public class MPlusHostnameVerifier implements HostnameVerifier {

	@Override
	public boolean verify(String hostname, SSLSession session) {
		HostnameVerifier hv = HttpsURLConnection.getDefaultHostnameVerifier();

		if(MPlusFrameworkConstants.DEBUG_MODE) {
			MPlusLogUtil.INFO(MPlusHostnameVerifier.class, "hostname : " + hostname + ", session : " + session);
		}


		return hv.verify(hostname, session);
	}

}
