gpt4 book ai didi

ssl - 如何在嵌入式 Jetty 上设置 SSL?

转载 作者:太空宇宙 更新时间:2023-11-03 12:52:08 33 4
gpt4 key购买 nike

我已经嵌入了 Jetty 7.x。基本上只是创建一个 SelectChannelConnector 来监听端口 80 和 WebAppContext 来部署单个 WAR 目录。

我现在需要添加 SSL(所有 keystore 的东西都已完成),我猜想只添加一个 SslSelectChannelConnector,但所有方法都已弃用,没有任何 javadoc 来解释原因以及应该做什么。 Jetty/SSL 文档只显示了一些 XML 而没有描述如何处理它。

任何人都可以在这里为我提供设置 SSL 和 Jetty 嵌入式实例的入口点吗?我不认为这会很复杂,我只是不知道在当前版本中从哪个类开始。

最佳答案

来自 Jetty 用户电子邮件组的回复:

David,

You need to create an instance of SslContextFactory and configure it with your keystore parameters. After that you'll need to pass that instance to the SslSelectChannelConnector's constructor. Recently modified configuration file jetty-ssl.xml shows how it is done in XmlConfiguration, and could be easily translated into code. This will be documented in Jetty Wiki as soon as we get a chance.

-Michael

关于ssl - 如何在嵌入式 Jetty 上设置 SSL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6053642/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com