mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix trust bug
This commit is contained in:
parent
64555cdc87
commit
7fd389c0b3
@ -21,6 +21,7 @@
|
||||
* 【core 】 修复CsvReader读取双引号未转义问题(issue#I2BMP1@Gitee)
|
||||
* 【json 】 JSONUtil.parse修复config无效问题(issue#1363@Github)
|
||||
* 【http 】 修复SimpleServer返回响应内容Content-Length不正确的问题(issue#1358@Github)
|
||||
* 【http 】 修复Https请求部分环境下报证书验证异常问题(issue#I2C1BZ@Github)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -1,12 +1,13 @@
|
||||
package cn.hutool.http.ssl;
|
||||
package cn.hutool.core.net;
|
||||
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
/**
|
||||
* 证书管理
|
||||
* 默认信任管理器,默认信任所有客户端和服务端证书
|
||||
*
|
||||
* @author Looly
|
||||
* @since 5.5.7
|
||||
*/
|
||||
public class DefaultTrustManager implements X509TrustManager {
|
||||
|
@ -52,7 +52,7 @@ public class SSLContextBuilder {
|
||||
|
||||
private String protocol = TLS;
|
||||
private KeyManager[] keyManagers;
|
||||
private TrustManager[] trustManagers;
|
||||
private TrustManager[] trustManagers = {new DefaultTrustManager()};
|
||||
private SecureRandom secureRandom = new SecureRandom();
|
||||
|
||||
|
||||
|
@ -4,9 +4,6 @@ import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.http.Header;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
@ -253,7 +253,7 @@ final class InternalJSONUtil {
|
||||
//默认使用时间戳
|
||||
long timeMillis;
|
||||
if (dateObj instanceof TemporalAccessor) {
|
||||
timeMillis = DateUtil.toInstant((TemporalAccessor) dateObj).toEpochMilli();
|
||||
timeMillis = TemporalAccessorUtil.toEpochMilli((TemporalAccessor) dateObj);
|
||||
} else if (dateObj instanceof Date) {
|
||||
timeMillis = ((Date) dateObj).getTime();
|
||||
} else if (dateObj instanceof Calendar) {
|
||||
|
Loading…
Reference in New Issue
Block a user