Jetty - 每个连接器的ipaccess?

问题描述 投票:1回答:1

假设我在jetty上启用ipaccess模块:

码头,ipaccess.xml

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

<!-- =============================================================== -->
<!-- The IP Access Handler -->
<!-- =============================================================== -->

<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="insertHandler">
<Arg>
<New id="IPAccessHandler" class="org.eclipse.jetty.server.handler.IPAccessHandler">
    <Set name="white">
     <Array type="String">
     <Item>127.0.0.1</Item>
     <Item>192.168.1.168</Item>    
     </Array>
    </Set>
    <Set name="whiteListByPath">false</Set>
</New>
</Arg>
</Call>
</Configure>

然后我用jetty/home/start.jar --add-to-start=ipaccess启用它

但我希望此过滤器仅适用于http连接器。我不希望它适用于我的https连接器。

如何配置它以便它只影响http模块,而不影响https模块?

注意:在Jetty 10中,此ipaccess模块​​被另一个模块替换:

https://github.com/eclipse/jetty.project/commit/3a4da94e1a69ee4c9cd3c936f50d58ee3440188e

ssl jetty
1个回答
1
投票

答案是这还不可能,因为只有在使用编程版本的jetty时才能分配IPAccessHandler或InetAccessHandler。不是当你用start.jar开始时。

所以我创建了问题:https://github.com/eclipse/jetty.project/issues/3562

我创建了一个公关来解决这个问题:https://github.com/eclipse/jetty.project/pull/3572

并且gregw@github接受了它,并在这里扩展它https://github.com/eclipse/jetty.project/pull/3576

一旦这是在9.4.x版本中,我将全部设置。

© www.soinside.com 2019 - 2024. All rights reserved.