Jetty的ssl模块

2024-03-10 09:12
文章标签 模块 ssl jetty

本文主要是介绍Jetty的ssl模块,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

启用ssl模块,执行如下命令:

java -jar $JETTY_HOME/start.jar --add-modules=ssl

命令的输出,如下:

INFO  : ssl             initialized in ${jetty.base}/start.d/ssl.ini
INFO  : Base directory was modified

查看ssl模块的配置文件,执行如下命令:

cat $JETTY_BASE/start.d/ssl.ini

命令的输出,如下:


# ---------------------------------------
# Module: ssl
# Enables a TLS (SSL) connector to support secure protocols.
# Secure HTTP/1.1 is provided by enabling the "https" module and secure HTTP/2 is provided by enabling the "http2" module.
# ---------------------------------------
--modules=ssl### TLS (SSL) Connector Configuration## The host/address to bind the connector to.
# jetty.ssl.host=0.0.0.0## The port the connector listens on.
# jetty.ssl.port=8443## The connector idle timeout, in milliseconds.
# jetty.ssl.idleTimeout=30000## The number of acceptors (-1 picks a default value based on number of cores).
# jetty.ssl.acceptors=1## The number of selectors (-1 picks a default value based on number of cores).
# jetty.ssl.selectors=-1## The ServerSocketChannel accept queue backlog (0 picks the platform default).
# jetty.ssl.acceptQueueSize=0## The thread priority delta to give to acceptor threads.
# jetty.ssl.acceptorPriorityDelta=0## Whether to enable the SO_REUSEADDR socket option.
# jetty.ssl.reuseAddress=true## Whether to enable the SO_REUSEPORT socket option.
# jetty.ssl.reusePort=false## Whether to enable the TCP_NODELAY socket option on accepted sockets.
# jetty.ssl.acceptedTcpNoDelay=true## The SO_RCVBUF socket option to set on accepted sockets.
## A value of -1 indicates that the platform default is used.
# jetty.ssl.acceptedReceiveBufferSize=-1## The SO_SNDBUF socket option to set on accepted sockets.
## A value of -1 indicates that the platform default is used.
# jetty.ssl.acceptedSendBufferSize=-1## Whether client SNI data is required for all secure connections.
## When SNI is required, clients that do not send SNI data are rejected with an HTTP 400 response.
# jetty.ssl.sniRequired=false## Whether client SNI data is checked to match CN and SAN in server certificates.
## When SNI is checked, if the match fails the connection is rejected with an HTTP 400 response.
# jetty.ssl.sniHostCheck=true## The max age, in seconds, for the Strict-Transport-Security response header.
# jetty.ssl.stsMaxAgeSeconds=31536000## Whether to include the subdomain property in any Strict-Transport-Security header.
# jetty.ssl.stsIncludeSubdomains=true### SslContextFactory Configuration
## Note that OBF passwords are not secure, just protected from casual observation.## Whether client SNI data is required for all secure connections.
## When SNI is required, clients that do not send SNI data are rejected with a TLS handshake error.
# jetty.sslContext.sniRequired=false## The Endpoint Identification Algorithm.
## Same as javax.net.ssl.SSLParameters#setEndpointIdentificationAlgorithm(String).
# jetty.sslContext.endpointIdentificationAlgorithm=## The JSSE Provider.
# jetty.sslContext.provider=## The KeyStore file path, either an absolute path or a relative path to $JETTY_BASE.
# jetty.sslContext.keyStorePath=etc/keystore.p12## The TrustStore file path, either an absolute path or a relative path to $JETTY_BASE.
# jetty.sslContext.trustStorePath=etc/keystore.p12## The KeyStore password.
# jetty.sslContext.keyStorePassword=## The Keystore type.
# jetty.sslContext.keyStoreType=PKCS12## The KeyStore provider.
# jetty.sslContext.keyStoreProvider=## The KeyManager password.
# jetty.sslContext.keyManagerPassword=## The TrustStore password.
# jetty.sslContext.trustStorePassword=## The TrustStore type.
# jetty.sslContext.trustStoreType=PKCS12## The TrustStore provider.
# jetty.sslContext.trustStoreProvider=## Whether client certificate authentication is required.
# jetty.sslContext.needClientAuth=false## Whether client certificate authentication is desired, but not required.
# jetty.sslContext.wantClientAuth=false## Whether cipher order is significant.
# jetty.sslContext.useCipherSuitesOrder=true## The SSLSession cache size.
# jetty.sslContext.sslSessionCacheSize=-1## The SSLSession cache timeout (in seconds).
# jetty.sslContext.sslSessionTimeout=-1## Whether TLS renegotiation is allowed.
# jetty.sslContext.renegotiationAllowed=true## The max number of TLS renegotiations per connection.
# jetty.sslContext.renegotiationLimit=5

各参数的说明,如下:

  • Connector对象的参数
    • jetty.ssl.host
      监听地址,默认值为0.0.0.0,表示在本机所有的IP均可接收请求。
    • jetty.ssl.port
      SSL服务的监听端口,默认值为8443
    • jetty.ssl.idleTimeout
      SSL链接处于空闲状态的超时值,超时后链接被自动释放,单位:毫秒,默认值为30000,即30秒。
    • jetty.ssl.acceptors
      accept对象的数量,默认值为1。取值为-1时,表示依据CPU核的数量来推算accept对象的数量。
    • jetty.ssl.selectors
      selector对象的数量,默认值为1。取值为-1时,表示依据CPU核的数量来推算selector对象的数量。
    • jetty.ssl.acceptQueueSize
      accept操作的backlog中请求的数量,默认值为0,表示使用操作系统的默认值。
    • jetty.ssl.acceptorPriorityDelta
      执行accept操作的线程的运行期优先级,默认值为0
      依据JDK中线程的文档,不同平台下线程运行优先级的实现存在比较大的差异,因此为保障代码的可移植性和正确性,业务逻辑的正确性不应对线程的优先级做出假设或者依赖。
    • jetty.ssl.reuseAddress
      对应socket选项SO_REUSEADDR,默认值为true
    • jetty.ssl.reusePort
      对应socket选项SO_REUSEPORT,默认值为false
    • jetty.ssl.acceptedTcpNoDelay
      对应socket选项TCP_NODELAY,默认值为true
    • jetty.ssl.acceptedReceiveBufferSize
      接收数据的缓冲区的大小,对应socket选项SO_RCVBUF,默认值为-1,表示使用操作系统的默认值。
    • jetty.ssl.acceptedSendBufferSize
      发送数据的缓冲区的大小,对应socket选项SO_SNDBUF,默认值为-1,表示使用操作系统的默认值。
    • jetty.ssl.sniRequired
      客户的SNI数据是否必需,默认值为false
    • jetty.ssl.sniHostCheck
      是否校验客户的SNI数据中的CNSAN
    • jetty.ssl.stsMaxAgeSeconds
      返回HTTP安全头部Strict Transport Security时,max-age字段的取值,单位:秒,默认值为31536000
      参考资料:
      • HTTP 安全响应头(Security Response header)配置
    • jetty.ssl.stsIncludeSubdomains
      返回HTTP安全头部Strict Transport Security时,是否包含includeSubDomains字段,默认值为true
      参考资料:
      • HTTP 安全响应头(Security Response header)配置
  • SslContextFactory对象的参数
    • jetty.sslContext.sniRequired
      所有安全链接中,客户的SNI数据是否必需,默认值为false
    • jetty.sslContext.endpointIdentificationAlgorithm
      javax.net.ssl.SSLParameters#setEndpointIdentificationAlgorithm(String)
    • jetty.sslContext.provider
    • jetty.sslContext.keyStorePath
      KeyStore文件的路径,支持使用相对于$JETTY_BASE的路径,也可以使用绝对路径。
    • jetty.sslContext.trustStorePath
      TrustStore文件的路径,支持使用相对于$JETTY_BASE的路径,也可以使用绝对路径。
    • jetty.sslContext.keyStorePassword
      KeyStore文件的口令。
    • jetty.sslContext.keyStoreType
      KeyStore文件的类型,默认值为PKCS12
    • jetty.sslContext.keyStoreProvider
    • jetty.sslContext.keyManagerPassword
      KeyManager的口令。
    • jetty.sslContext.trustStorePassword
      TrustStore文件的口令。
    • jetty.sslContext.trustStoreType
      TrustStore文件的类型,默认值为PKCS12
    • jetty.sslContext.trustStoreProvider
    • jetty.sslContext.needClientAuth
      是否需要执行客户端认证,默认值为false
    • jetty.sslContext.wantClientAuth
      是否期望执行客户端认证,默认值为false
    • jetty.sslContext.useCipherSuitesOrder
      是否验证加密顺序,默认值为true
    • jetty.sslContext.sslSessionCacheSize
      SSLSession缓存占用的容量,默认值为-1
    • jetty.sslContext.sslSessionTimeout
      SSLSession缓存的超时值,单位:秒,默认值为-1
    • jetty.sslContext.renegotiationAllowed
      是否允许尝试重复执行TLS协商,默认值为true
    • jetty.sslContext.renegotiationLimit
      单个通信链接,TLS协商次数的上限值,默认值为5

这篇关于Jetty的ssl模块的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/793760

相关文章

python: 多模块(.py)中全局变量的导入

文章目录 global关键字可变类型和不可变类型数据的内存地址单模块(单个py文件)的全局变量示例总结 多模块(多个py文件)的全局变量from x import x导入全局变量示例 import x导入全局变量示例 总结 global关键字 global 的作用范围是模块(.py)级别: 当你在一个模块(文件)中使用 global 声明变量时,这个变量只在该模块的全局命名空

深入探索协同过滤:从原理到推荐模块案例

文章目录 前言一、协同过滤1. 基于用户的协同过滤(UserCF)2. 基于物品的协同过滤(ItemCF)3. 相似度计算方法 二、相似度计算方法1. 欧氏距离2. 皮尔逊相关系数3. 杰卡德相似系数4. 余弦相似度 三、推荐模块案例1.基于文章的协同过滤推荐功能2.基于用户的协同过滤推荐功能 前言     在信息过载的时代,推荐系统成为连接用户与内容的桥梁。本文聚焦于

消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法

消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法   消除安卓SDK更新时的“https://dl-ssl.google.com refused”异常的方法 [转载]原地址:http://blog.csdn.net/x605940745/article/details/17911115 消除SDK更新时的“

Jenkins构建Maven聚合工程,指定构建子模块

一、设置单独编译构建子模块 配置: 1、Root POM指向父pom.xml 2、Goals and options指定构建模块的参数: mvn -pl project1/project1-son -am clean package 单独构建project1-son项目以及它所依赖的其它项目。 说明: mvn clean package -pl 父级模块名/子模块名 -am参数

寻迹模块TCRT5000的应用原理和功能实现(基于STM32)

目录 概述 1 认识TCRT5000 1.1 模块介绍 1.2 电气特性 2 系统应用 2.1 系统架构 2.2 STM32Cube创建工程 3 功能实现 3.1 代码实现 3.2 源代码文件 4 功能测试 4.1 检测黑线状态 4.2 未检测黑线状态 概述 本文主要介绍TCRT5000模块的使用原理,包括该模块的硬件实现方式,电路实现原理,还使用STM32类

Android逆向(反调,脱壳,过ssl证书脚本)

文章目录 总结 基础Android基础工具 定位关键代码页面activity定位数据包参数定位堆栈追踪 编写反调脱壳好用的脚本过ssl证书校验抓包反调的脚本打印堆栈bilibili反调的脚本 总结 暑假做了两个月的Android逆向,记录一下自己学到的东西。对于app渗透有了一些思路。 这两个月主要做的是代码分析,对于分析完后的持久化等没有学习。主要是如何反编译源码,如何找到

python内置模块datetime.time类详细介绍

​​​​​​​Python的datetime模块是一个强大的日期和时间处理库,它提供了多个类来处理日期和时间。主要包括几个功能类datetime.date、datetime.time、datetime.datetime、datetime.timedelta,datetime.timezone等。 ----------动动小手,非常感谢各位的点赞收藏和关注。----------- 使用datet

C8T6超绝模块--EXTI

C8T6超绝模块–EXTI 大纲 控制流程结构体分析EXTI实现按键 具体案例 控制流程 这里是流程框图,具体可以去看我STM32专栏的EXTI的具体分析 结构体分析 typedef struct {uint32_t EXTI_Line; // 中断/事件线EXTIMode_TypeDef EXTI_Mode; // EXTI 模式EXTITrigger_TypeDef EXTI_

1、创建多模块的maven springboot项目

现在的java的项目都是多模块的,这次也跟个风。 目标:实现下述结构 项目AcedBoot, 子模块:         aced-api 对外提供接口,         aced-web 给前端提供接口,         aced-service 服务层,         aced-dao 数据底层,包含数据库mapper和实体类entity,         aced-commo

Vue2电商项目(二) Home模块的开发;(还需要补充js节流和防抖的回顾链接)

文章目录 一、Home模块拆分1. 三级联动组件TypeNav2. 其余组件 二、发送请求的准备工作1. axios的二次封装2. 统一管理接口API----跨域3. nprogress进度条 三、 vuex模块开发四、TypeNav三级联动组件开发1. 动态展示三级联动数据2. 三级联动 动态背景(1)、方式一:CSS样式(2)、方式二:JS 3. 控制二三级数据隐藏与显示--绑定styl