---
title: "APR为JBoss AS加速：HTTPS Connector配置"
author: "JBossWeek"
date: "2007-10-01T20:40:00Z"
tags: ["JBoss", "Scheme", "Socket", "算法"]
slug: "apr-jboss-as-https-connector"
draft: false
lastmod: "2007-10-01T20:40:00Z"
id: 138897
url: "https://jbossweek.iteye.com/blog/138897"
---

当启用APR时，HTTPS connector将使用socket poller实现keepalive，增加服务器的扩展性。它还使用OpenSSL，这比使用依赖处理器的JSSE更能优化服务器的性能，并且能够与许多商业加速组件配合使用。与HTTP connector不同的是，HTTPS connector不能使用sendfile优化静态文件处理的性能。

除了提供与HTTP APR connector相同的属性以外，HTTPS APR connector还提供了OpenSSL相关的属性。关于如何使用OpenSSL的详细说明，请参考OpenSSL文档和相关书籍（参看[OpenSSL官方网站](http://www.openssl.org/)）。Connctor中SSL相关的属性如下：

**Attribute**

**Description**

SSLEngine

设置是否使用SSLEngine。off：不使用SSL，on：使用SSL但是不设置ENGINE。缺省值为off。

SSLProtocol

设置与客户端通讯的协议。缺省值为“all”，其它可以接受的值为"SSLv2", "SSLv3", "TLSv1", 以及 "SSLv2+SSLv3"。

SSLCipherSuite

设置与客户端通讯时使用的加密算法。缺省值为“ALL”,其它可以接受的值为“:”分开的加密算法列表（关于支持的加密算法列表请查看OpenSSL文档）。

**SSLCertificateFile**

设置包含服务器证书的文件名。证书格式为PEM。

SSLCertificateKeyFile

设置包含服务器私钥的文件名。私钥格式为PEM。缺省值为"SSLCertificateFile"（不推荐使用），该文件中必须同时包括证书和私钥。

SSLPassword

加密私钥的pass phrase。如果没有设置"SSLPassword"，回调函数将提示输入pass phrase。

SSLVerifyClient

表示是否向客户端请求证书。缺省值为"none"，表示不需要客户端发送证书。其它可接受的值包括"optional", "require" 和 "optionalNoCA"。

SSLVerifyDepth

客户端证书的最大验证深度。缺省值为10。

SSLCACertificateFile

See [the mod\_ssl documentation.](http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslcacertificatefile)

SSLCACertificatePath

See [the mod\_ssl documentation.](http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslcacertificatepath)

SSLCertificateChainFile

See [the mod\_ssl documentation.](http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslcertificatechainfile)

SSLCARevocationFile

See [the mod\_ssl documentation.](http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslcarevocationfile)

SSLCARevocationPath

See [the mod\_ssl documentation.](http://httpd.apache.org/docs/2.2/mod/mod_ssl.html#sslcarevocationpath)

SSL Connector 示例配置如下:

&lt;Connector port="443" maxHttpHeaderSize="8192"

           maxThreads="50" enableLookups="false" disableUploadTimeout="true"

           acceptCount="100" scheme="https" secure="true"

           SSLEngine="on"

           SSLCertificateFile="${catalina.base}/conf/localhost.crt"

           SSLCertificateKeyFile="${catalina.base}/conf/localhost.key" /&gt;