mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix #3582
This commit is contained in:
@@ -12,11 +12,13 @@
|
||||
|
||||
package org.dromara.hutool.core.net.ssl;
|
||||
|
||||
import org.dromara.hutool.core.exception.HutoolException;
|
||||
import org.dromara.hutool.core.io.IORuntimeException;
|
||||
|
||||
import javax.net.ssl.KeyManager;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/**
|
||||
* SSL(Secure Sockets Layer 安全套接字协议)中的{@link SSLContext}相关工具封装
|
||||
@@ -26,6 +28,20 @@ import javax.net.ssl.TrustManager;
|
||||
*/
|
||||
public class SSLContextUtil {
|
||||
|
||||
/**
|
||||
* 获取默认的{@link SSLContext}
|
||||
*
|
||||
* @return {@link SSLContext}
|
||||
* @since 6.0.0
|
||||
*/
|
||||
public static SSLContext getDefault() {
|
||||
try {
|
||||
return SSLContext.getDefault();
|
||||
} catch (final NoSuchAlgorithmException e) {
|
||||
throw new HutoolException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建{@link SSLContext},信任全部,协议为TLS
|
||||
*
|
||||
|
Reference in New Issue
Block a user