We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
源码在这里: https://github.com/opensolon/solon/blob/main/__hatch/solon-boot-tomcat/src/main/java/org/noear/solon/boot/tomcat/TomcatServerBase.java
现在不支持HTTPS,Hutool在封装简单的Server门面时,做了实现,可以参考:
https://github.com/dromara/hutool/blob/v6-dev/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/tomcat/TomcatEngine.java#L125
懒得提PR了,哈哈,做个参考吧。
Hutool中所有HTTPS的启用都是基于javax.net.ssl.SSLContext的,在配置文件中,如果用户传入了这个对象,表示要启用HTTPS,则核心代码为:
javax.net.ssl.SSLContext
final Http11NioProtocol protocol = new Http11NioProtocol(); protocol.setSSLEnabled(true); protocol.setSecure(true); protocol.addSslHostConfig(createSSLHostConfig(sslContext));
createSSLHostConfig就是将SSLContext构建为SSLHostConfig。 tomcat本身提供了一个org.apache.tomcat.util.net.SSLContext,因此我弄了一个JSSESSLContext将javax的转为tomcat的(PS:tomcat真恶心……),tomcat本身也提供了一个org.apache.tomcat.util.net.jsse.JSSESSLContext,不能传SSLContext,只能传KeyManager之类的,因此我自己写了一个……
SSLContext
SSLHostConfig
org.apache.tomcat.util.net.SSLContext
JSSESSLContext
org.apache.tomcat.util.net.jsse.JSSESSLContext
KeyManager
希望对你有用。
PS:Hutool-6.x在http模块中提供了一个简单的ServerEngine接口,用于提供http服务器的门面,类似solon中的ServerLifecycle,都是为了简化服务创建和启动差异,也参考了solon的很多实现,在此感谢~~
ServerEngine
ServerLifecycle
The text was updated successfully, but these errors were encountered:
感谢!
Sorry, something went wrong.
No branches or pull requests
源码在这里:
https://github.com/opensolon/solon/blob/main/__hatch/solon-boot-tomcat/src/main/java/org/noear/solon/boot/tomcat/TomcatServerBase.java
现在不支持HTTPS,Hutool在封装简单的Server门面时,做了实现,可以参考:
https://github.com/dromara/hutool/blob/v6-dev/hutool-http/src/main/java/org/dromara/hutool/http/server/engine/tomcat/TomcatEngine.java#L125
懒得提PR了,哈哈,做个参考吧。
Hutool中所有HTTPS的启用都是基于
javax.net.ssl.SSLContext
的,在配置文件中,如果用户传入了这个对象,表示要启用HTTPS,则核心代码为:createSSLHostConfig就是将
SSLContext
构建为SSLHostConfig
。tomcat本身提供了一个
org.apache.tomcat.util.net.SSLContext
,因此我弄了一个JSSESSLContext
将javax的转为tomcat的(PS:tomcat真恶心……),tomcat本身也提供了一个org.apache.tomcat.util.net.jsse.JSSESSLContext
,不能传SSLContext
,只能传KeyManager
之类的,因此我自己写了一个……希望对你有用。
The text was updated successfully, but these errors were encountered: