diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java index ad54a97..e3be2fa 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/service/impl/WpsServiceImpl.java @@ -607,9 +607,15 @@ public class WpsServiceImpl implements WpsService { dataJson = JSON.toJSONString(vo); } - String retJson = HttpUtils.httpPost(url, dataJson);//httpPost(kswpsurl,json); + //String retJson = HttpUtils.httpPost(url, dataJson);//httpPost(kswpsurl,json); + String retJson = ""; + if(url.indexOf("https://")>=0){ + retJson = HttpsUtils.UrlPost(url, "utf-8", dataJson); + }else{ + retJson = HttpUtils.httpPost(url, dataJson); + } + log.info("ret:"+retJson); - //String retJson = HttpUtils.httpPost(kswpsurl,json); KingSoftWpsRet ret = JSON.parseObject(retJson,KingSoftWpsRet.class); diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/util/HttpsUtils.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/util/HttpsUtils.java index ac2bc6b..b0c7de0 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/util/HttpsUtils.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/wps/util/HttpsUtils.java @@ -19,7 +19,7 @@ import java.util.Map; @Slf4j public class HttpsUtils { - + public static String UrlPost(String url,String charSet, String json){ return UrlPost(url,charSet,json,null); } @@ -104,6 +104,7 @@ public class HttpsUtils { return str; } + private static class TrustAnyTrustManager implements X509TrustManager { @Override public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {