启用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

      参考资料:

    • jetty.ssl.stsIncludeSubdomains

      返回HTTP安全头部Strict Transport Security时,是否包含includeSubDomains字段,默认值为true

      参考资料:

  • 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模块的更多相关文章

  1. python安装完毕后,提示找不到ssl模块的解决步骤

    转载自 醇酒醉影 python安装完毕后,提示找不到ssl模块: [root@localhost ~]# python2.7.5 Python 2.7.5 (default, Jun 3 2013, ...

  2. 编译安装带ssl 模块指定版本Python

      出现这个或者fatal error: openssl/名单.h: No such file or directory.都是没有安装libssl-dev- libssl-dev包含libraries ...

  3. nginx使用ssl模块配置支持HTTPS访问

    默认情况下ssl模块并未被安装,如果要使用该模块则需要在编译nginx时指定–with-http_ssl_module参数. 需求: 做一个网站域名为 www.localhost.cn 要求通过htt ...

  4. nginx使用ssl模块配置HTTPS支持

    默认情况下ssl模块并未被安装,如果要使用该模块则需要在编译时指定–with-http_ssl_module参数,安装模块依赖于OpenSSL库和一些引用文件,通常这些文件并不在同一个软件包中.通常这 ...

  5. python安装完毕后,提示找不到ssl模块的解决方示

    python安装完毕后,提示找不到ssl模块: [root@localhost ~]# python2.7.5 Python 2.7.5 (default, Jun 3 2013, 11:08:43) ...

  6. Windows下Apache添加SSL模块

    参考资料:http://www.yuansir-web.com/2011/05/12/hello-world/测试环境:windows2003 32位 + Apache2.4 + PHP5.4 一.准 ...

  7. nginx使用ssl模块配置支持HTTPS访问【解决ssl错误】

    默认情况下ssl模块并未被安装,如果要使用该模块则需要在编译nginx时指定–with-http_ssl_module参数. 需求:做一个网站域名为 www.localhost.cn 要求通过http ...

  8. Python3中无法导入ssl模块的解决办法

    这个问题,已经困扰我好几天了,本萌新刚开始接触python,想爬取几个网页试试,发现urllib无法识别https,百度后才知道要导入ssl模块,可是发现又报错了. 本人实在无法理解为什么会报错,因为 ...

  9. Nginx下配置SSL模块,支持https

    Http与Https的区别 HTTP:是互联网上应用最为广泛的一种网络协议,是一个客户端和服务器端请求和应答的标准(TCP),用于从WWW服务器传输超文本到本地浏览器的传输协议,它可以使浏览器更加高效 ...

  10. pip命令出现了问题,提示说找不到ssl模块

    Could not find a version that satisfies the requirement pygame (from versions: ) No matching distrib ...

随机推荐

  1. 【LeetCode字符串#extra】KMP巩固练习:旋转字符串、字符串轮转

    旋转字符串 https://leetcode.cn/problems/rotate-string/ 给定两个字符串, s 和 goal.如果在若干次旋转操作之后,s 能变成 goal ,那么返回 tr ...

  2. 关于Python中math 和 decimal 模块的解析与实践

    本文分享自华为云社区<Python数学模块深度解析与实战应用>,作者: 柠檬味拥抱. 在Python中,math 和 decimal 模块是处理数学运算的重要工具.math 提供了一系列常 ...

  3. 【Azure 云服务】如果云服务证书过期会有什么影响,证书时间应该如何查看

    问题描述 如果云服务证书过期会有什么影响,证书时间应该如何查看 问题答案 在云服务中,有两种证书:服务证书 和 管理证书 什么是服务证书? 通过浏览器访问云服务中的服务(Web Role)时候所使用的 ...

  4. 代码随想录算法训练营第三十天| 51. N皇后 37. 解数独 总结

           卡哥建议:今天这三道题都非常难,那么这么难的题,为啥一天做三道? 因为 一刷 也不求大家能把这么难的问题解决,所以 大家一刷的时候,就了解一下题目的要求,了解一下解题思路,不求能直接写出 ...

  5. CXPACKET等待类型分析

    背景 客户反馈今天8点钟开始进入业务高峰期后,数据库的CPU利用率非常高,基本达到了100%,前端应用也非常慢.怀疑是昨晚业务系统升级导致,请我们紧急协助分析. 现象 登录到SQL专家云,进入相关时间 ...

  6. Inertial Explorer Xpress 学习笔记

    KEY WORDS: Coordinate Updates (CUPTs) Zero Velocity Updates (ZUPTs) Google Protocol Buffer (GPB)  是一 ...

  7. multiple definition of `MainWindow::MainWindow(QWidget*)

    qt刚建好工程运行的时候没问题,后面写了一点东西之后,再运行就发现出现MainWindow重复,我不理解. 解决方法:删除重复的引用. 再重新构建一下就好了.

  8. 微软应用商店错误代码“0x80131500”怎么修复?

    处理方法一 打开"运行"输入 inetcpl.cpl ("WINDOWS"+"R"键,输入 inetcpl.cpl亦可),点开高级往下拉,勾 ...

  9. Zabbix“专家坐诊”第187期问答汇总

    问题一 Q:zabbix server 5.0有办法不通过脚本监控SSL证书到期时间么? A:目前还是流行通过脚本方式去获取. Q:如果是通配符证书应该怎么监控? A:通过解析域名获取对应的过期时间的 ...

  10. Go | Gin 解决跨域问题跨域配置

    Go | Gin 解决跨域问题跨域配置 目录 一.关于跨域解决方案 二.使用步骤 1. 编写一个中间件 2. 使用 3. 注意事项 一.关于跨域解决方案 关于跨域的解决方法,大部分可以分为 2 种 n ...