import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import sun.net.www.protocol.https.DefaultHostnameVerifier;
-import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.net.HttpURLConnection;
RestResponse restResponse = new RestResponse();
url = url.replaceAll("\\s", "%20");
- URL obj = new URL(null, url, new sun.net.www.protocol.https.Handler());
+ URL obj = new URL(null, url);
HttpsURLConnection con = (HttpsURLConnection)obj.openConnection();
// optional default is GET
con.setRequestMethod("GET");
- HostnameVerifier hostnameVerifier = new DefaultHostnameVerifier();
- con.setHostnameVerifier(hostnameVerifier);
addHttpsRequestHeaders(headers, con);
Boolean multiPart = false;
if(headers.get(HttpHeaderEnum.ACCEPT.getValue()) != null) {
public RestResponse httpsSendPost(String url, String body, Map<String, String> headers) throws IOException {
RestResponse restResponse = new RestResponse();
- URL obj = new URL(null, url, new sun.net.www.protocol.https.Handler());
+ URL obj = new URL(null, url);
HttpsURLConnection con = (HttpsURLConnection)obj.openConnection();
- HostnameVerifier hostnameVerifier = new DefaultHostnameVerifier();
- con.setHostnameVerifier(hostnameVerifier);
// add request method
con.setRequestMethod("POST");
// add request headers
public RestResponse httpsSendByMethod(String url, String method, String body, Map<String, String> headers) throws IOException {
RestResponse restResponse = new RestResponse();
- URL obj = new URL(null, url, new sun.net.www.protocol.https.Handler());
+ URL obj = new URL(null, url);
HttpsURLConnection con = (HttpsURLConnection)obj.openConnection();
- HostnameVerifier hostnameVerifier = new DefaultHostnameVerifier();
- con.setHostnameVerifier(hostnameVerifier);
// add request method
con.setRequestMethod(method);
// add request headers
public RestResponse httpsSendDelete(String url, Map<String, String> headers) throws IOException {
RestResponse restResponse = new RestResponse();
- URL obj = new URL(null, url, new sun.net.www.protocol.https.Handler());
+ URL obj = new URL(null, url);
HttpsURLConnection con = (HttpsURLConnection)obj.openConnection();
- HostnameVerifier hostnameVerifier = new DefaultHostnameVerifier();
- con.setHostnameVerifier(hostnameVerifier);
// add request headers
addHttpRequestHEaders(headers, con);