This commit is contained in:
@@ -126,6 +126,12 @@
|
|||||||
-->
|
-->
|
||||||
<server protocol="HTTP" host="127.0.0.1" port="6060" root="root" lib="">
|
<server protocol="HTTP" host="127.0.0.1" port="6060" root="root" lib="">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
【节点在<server>中唯一】
|
||||||
|
value: 创建SSLContext的实现类, 可自定义,必须是org.redkale.net.SSLCreator的子类
|
||||||
|
-->
|
||||||
|
<ssl creator="" p12="{APP_HOME}/conf/xxx.p12" jks="{APP_HOME}/conf/xxx.jks" pem="{APP_HOME}/conf/xxx.pem"/>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
加载所有的Service服务;
|
加载所有的Service服务;
|
||||||
在同一个进程中同一个name同一类型的Service将共用同一个实例
|
在同一个进程中同一个name同一类型的Service将共用同一个实例
|
||||||
|
|||||||
@@ -127,15 +127,16 @@ public abstract class Server<K extends Serializable, C extends Context, R extend
|
|||||||
AnyValue sslConf = config.getAnyValue("ssl");
|
AnyValue sslConf = config.getAnyValue("ssl");
|
||||||
if (sslConf != null) {
|
if (sslConf != null) {
|
||||||
String creatorClass = sslConf.getValue("creator", SSLCreator.class.getName());
|
String creatorClass = sslConf.getValue("creator", SSLCreator.class.getName());
|
||||||
|
SSLCreator creator = null;
|
||||||
if (SSLCreator.class.getName().equals(creatorClass) || creatorClass.isEmpty()) {
|
if (SSLCreator.class.getName().equals(creatorClass) || creatorClass.isEmpty()) {
|
||||||
this.sslContext = new SSLCreator() {
|
creator = new SSLCreator() {
|
||||||
}.create(this, sslConf);
|
};
|
||||||
} else {
|
} else {
|
||||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||||
@SuppressWarnings("unchecked")
|
creator = ((SSLCreator) classLoader.loadClass(creatorClass).getDeclaredConstructor().newInstance());
|
||||||
SSLCreator creator = ((SSLCreator) classLoader.loadClass(creatorClass).getDeclaredConstructor().newInstance());
|
|
||||||
this.sslContext = creator.create(this, sslConf);
|
|
||||||
}
|
}
|
||||||
|
this.resourceFactory.inject(creator);
|
||||||
|
this.sslContext = creator.create(this, sslConf);
|
||||||
}
|
}
|
||||||
final AtomicInteger counter = new AtomicInteger();
|
final AtomicInteger counter = new AtomicInteger();
|
||||||
final Format f = createFormat();
|
final Format f = createFormat();
|
||||||
|
|||||||
Reference in New Issue
Block a user