📄 ssl-quick.xtp
字号:
<s1 title="SSL Test Installation"><summarylist/><s2 title="Using OpenSSL on Unix"><p>On Unix systems, Resin's JNI libraries can support SSL using the<a href="http://www.openssl.org">OpenSSL</a> libraries.Although the ./configure script will detect many configurations,you can specify the openssl location directly:</p><example>resin> ./configure --with-openssl=/usr/local/ssl</example><p>The SSL port is configured in the httpd.conf's <http> element byadding the <var/ssl/> flag and configuring a key with the<var/certificate-pem/> element:</p><example>...<http-server> <http port='443' ssl> <certificate-file>/opt/resin/cert/ssl.crt>/certificate-file> <certificate-key-file>/opt/resin/cert/ssl.key>/certificate-key-file> </http> ...</http-server></example><p>Since OpenSSL uses the same certificate as Apache, you canget signed certificates using the same method as for Apache'smod_ssl or following the OpenSSL instructions.</p><p>OpenSSL's engine support is configured with crypto-device.</p></s2><s2 title="Install JSSE from Sun"><p>If OpenSSL is not available, you can use Sun's JSSE to provideSSL. Sun's implementation of JSSE is significantlyslower than OpenSSL, though.</p><p>This section gives a quick guide to installing a test SSLconfiguration using Sun's JSSE. It avoids as many complications aspossible and uses Sun's keytool to create a server certificate.</p><p>Resin's SSL support is provided by Sun's<a href='http://java.sun.com/products/jsse'>JSSE</a>. Because ofexport restrictions, patents, etc, you'll need to download the JSSEdistribution from Sun or get a commercial JSSE implementation.</p><p>More complete JSSE installation instructions for JSSE are at<a href="http://java.sun.com/products/jsse/install.html">http://java.sun.com/products/jsse/install.html</a>.</p><ol><li>First download Sun's <a href="http://java.sun.com/products/jsse">JSSE</a>.<li>Uncompress and extract the downloaded file.<li>Install the JSSE jar files: jsse.jar, jnet.jar, and jcert.jar. You caneither put them into the CLASSPATH or you can put them into $JAVA_HOME/jre/lib/ext. Since you will use "keytool" with the new jars, you need to make themvisible to keytool. Just adding them to resin/lib is not enough.<li>Register the JSSE provider (com.sun.net.ssl.internal.ssl.Provider).Modify $JAVA_HOME/jre/lib/security/java.security so it contains something like:<example>security.provider.1=sun.security.provider.Sunsecurity.provider.2=com.sun.net.ssl.internal.ssl.Provider</example>Adding the JSSE provider allows "keytool" to create a key using the RSAalgorithm.</ol></s2><s2 title="Create a test server certificate"><p>The server certificate is the core of SSL. It will identify your server andcontain the secret key to make encryption work.</p><ul><li>Sun's keytool<li>A self-signed certificate using open_ssl<li>A test certificate from Thawte<li>A production certificate from one of the certificate authorities (Verisign, Thawte, etc)</ul><p>In this case, we're using Sun's <var/keytool/> to generate theserver certificate. Here's how:</p><example>resin1.2.b2> <var/mkdir keys/>resin1.2.b2> <var/keytool -genkey -keyalg RSA -keystore keys/server.keystore/>Enter keystore password: <var/changeit/>What is your first and last name? [Unknown]: <var/www.caucho.com/>What is the name of your organizational unit? [Unknown]: <var/Resin Engineering/>What is the name of your organization? [Unknown]: <var/Caucho Technology, Inc./>What is the name of your City or Locality? [Unknown]: <var/San Francisco/>What is the name of your State or Province? [Unknown]: <var/California/>What is the two-letter country code for this unit? [Unknown]: <var/US/>Is <CN=www.caucho.com, OU=Resin Engineering, O="Caucho Technology, Inc.", L=San Francisco, ST=California, C=US> correct? [no]: <var/yes/>Enter key password for <mykey> (RETURN if same as keystore password): <var/changeit/></example><p>Currently, the key password and the keystore password must be the same.</p></s2><s2 title="resin.conf"><p>The Resin SSL configuration extends the http configuration with a few newelements.</p><example><caucho.com> <http-server> <http port=8443> <ssl>true</ssl> <key-store-file>keys/server.keystore</key-store-file> <key-store-password>changeit</key-store-password> </http> ... </http-server></caucho.com></example></s2><s2 title="Testing"><p>With the above configuration, you can test SSL with https://localhost:8443.A quick test is the following JSP.</p><example>Secure? <%= request.isSecure() %></example></s2></s1>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -