package com.example.treadmill.util;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.X509TrustManager;
/**
* 类名: MyX509TrustManager <br/>
* 描述:信任管理器 <br/>
* 开发人员: sy <br/>
* 创建时间:2016-9-27 <br/>
* 发布版本:V1.0 <br/>
*/
public class MyX509TrustManager implements X509TrustManager {
// 检查客户端证书
public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
}
// 检查服务器端证书
public void checkServerTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
}
// 返回受信任的X509证书数组
public X509Certificate[] getAcceptedIssuers() {
return null;
}
}
package com.example.treadmill.util;
/** 微信活动用的配置
* @author lps
* @time 2018年7月6日 下午4:47:21
* @version V1.0
*/
public class WxConfig {
/** 微信公众号通过code获取openid */
public static String wxUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
/** 获取用户基本信息(包括UnionID机制) */
public static String wxUserInfo = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN";
/** 微信公众号配置 测试配置 */
// public static final String APPID = "???";
// public static final String SECRET= "???";
/** 微信公众号配置 正式配置 */
public static final String APPID = "???";
public static final String SECRET= "???";
/** 公众号和小程序均可以使用AppID和AppSecret调用本接口来获取access_token */
public static final String token = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
/** jsapi_ticket是公众号用于调用微信JS接口的临时票据 */
public static final String ticket = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi";
/** 用来保存access_token的xml文件 */
public static final String WXCONFIG_PATH = "wxconfig.xml";
/** 用来保存jsapi_ticket */
public static final String WX_JSAPI_TICKET = "jsapi_ticket.xml";
}