鹏元接口

This commit is contained in:
zhouyahui 2019-06-11 09:59:42 +08:00
parent da9b57b733
commit eb54dde829
5 changed files with 14 additions and 9 deletions

Binary file not shown.

View File

@ -7,7 +7,8 @@ keyword4 =
keyword5 =
#pengyuan
pengyuanUrl = https://test.pycredit.com:6443/services/WebServiceSingleQuery?wsdl
pengyuanUrl=https://test.pycredit.com:6443
pengyuanServer=/services/WebServiceSingleQuery?wsdl
userId = apwsqueryn01
password = {MD5}i3rx5Ta+2VL5Dj5T866giQ==
methodType = queryReport

View File

@ -28,9 +28,9 @@ public class PyConfig {
// 请求内容样本文件实际中可使用具体对象组装
public final static String QUERY_XML_FILE = "d:/sample.xml";
public final static String KEYSTORE_FILE = "C:/Users/luojian/Desktop/安鹏/接口/01接口文档资料/鹏元测试证书/pytest.jks";
public final static String KEYSTORE_FILE = "D1:/tenwaWork/apzl/08年度2019鹏元/03执行/01接口文档资料/鹏元测试证书/pytest.jks";
public final static String KEYSTORE_PASSWORD = "123456";
public final static String TRUSTSTORE_FILE = "C:/Users/luojian/Desktop/安鹏/接口/01接口文档资料/鹏元测试证书/pytest2.jks";
public final static String TRUSTSTORE_FILE = "D1:/tenwaWork/apzl/08年度2019鹏元/03执行/01接口文档资料/鹏元测试证书/pytest2.jks";
public final static String TRUSTSTORE_PASSWORD = "123456";
public final static String AES_KEY = "";

View File

@ -4,6 +4,7 @@ package com.tenwa.httpclient;
import com.amarsoft.awe.Configure;
import com.tenwa.httpclient.PyConfig;
import java.io.FileInputStream;
@ -44,13 +45,16 @@ public class PySSLContextUtil {
* 使用该SSLContext, 证书可自定义
*
* @return
* @throws NoSuchAlgorithmException
* @throws Exception
*/
public static SSLContext createCustomerSSLContext() throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException, CertificateException, UnrecoverableKeyException {
SSLContext context = SSLContext.getInstance("TLSv1.2");
KeyStore keyStore = getKeyStore("JKS", new FileInputStream(PyConfig.KEYSTORE_FILE), PyConfig.KEYSTORE_PASSWORD);
public static SSLContext createCustomerSSLContext() throws Exception {
Configure CurConfig = Configure.getInstance();
SSLContext context = SSLContext.getInstance("TLSv1.2");
//KeyStore keyStore = getKeyStore("JKS", new FileInputStream(PyConfig.KEYSTORE_FILE), PyConfig.KEYSTORE_PASSWORD);
KeyStore keyStore = getKeyStore("JKS", new FileInputStream(CurConfig.getConfigure("KEYSTORE_FILE")), CurConfig.getConfigure("KEYSTORE_PASSWORD"));
KeyManager[] kms = createKeyManager(keyStore, PyConfig.KEYSTORE_PASSWORD);
KeyStore trustStore = getKeyStore("JKS", new FileInputStream(PyConfig.TRUSTSTORE_FILE), PyConfig.TRUSTSTORE_PASSWORD);
KeyStore trustStore = getKeyStore("JKS", new FileInputStream(CurConfig.getConfigure("TRUSTSTORE_FILE")), CurConfig.getConfigure("TRUSTSTORE_PASSWORD"));
//带公钥证书
// TrustManager[] tms = createTrustManager(trustStore);
// context.init(kms, tms, null);

View File

@ -778,7 +778,7 @@ public class BigDataController {
String result = "";
try{
result = PyUtils.requestApi(
BigDataPropertiesUtil.get("pengyuanUrl"),
BigDataPropertiesUtil.get("pengyuanUrl")+BigDataPropertiesUtil.get("pengyuanServer"),
BigDataPropertiesUtil.get("methodType"),
para);
System.out.println(result);