Resin 啟用 HTTPS 需配置 <http-server> 節點下的 SSL 相關元素。本文採用 JDK 1.4 內建 **Sun JSSE** 方案,在 Windows 2000 上以 keytool 生成伺服器證書並修改 resin.conf,完成端到端 SSL 啟用與驗證。
keytool (JDK bin 目錄)keytool -genkey -alias mykey -keyalg RSA -keystore keys/server.keystore
localhost 或實際域名),否則瀏覽器會彈出憑證不匹配警告。keys/server.keystore(相對 Resin 根目錄)。在 <http-server> 下擴展:
<caucho.com>
<security-provider id="com.sun.net.ssl.internal.ssl.Provider"/>
</caucho.com>
<http-server>
<doc>doc</doc>
<http port="80"/>
<srun port="6802" host="localhost"/>
<!-- HTTPS 配置 -->
<http port="443">
<ssl>true</ssl>
<key-store-file>keys/server.keystore</key-store-file>
<key-store-password>YourPassWordHere</key-store-password>
</http>
</http-server>
關鍵屬性:key-store-file 相對路徑、key-store-password 與生成時一致。
bin/httpd.exe 啟動 Resin。https://localhost/,接受安全警告(自簽證書)。isSecure.jsp:Secure? <%= request.isSecure() %>
訪問 https://localhost/isSecure.jsp,顯示 Secure? true 即成功。
「SSL 配置核心在於:真隨機金鑰生成、CN 匹配域名、私鑰保護、證書鏈完整。Resin 配置極簡,難點在 PKI 基礎設施而非伺服器本身。」