Date: 2003-12-17T12:28:29
   Editor: 63.116.136.130 <>
   Wiki: Apache James Wiki
   Page: James/UsingSSL
   URL: http://wiki.apache.org/james/James/UsingSSL

   fixed wiki syntax

Change Log:

------------------------------------------------------------------------------
@@ -56,53 +56,53 @@
 
 ----
 In config.xml, setup a different service for ssl/tls, using port 465 (just 
duplicate the existing entry for the smtpserver service, change the name to 
smtpserver-tls and change the entries as shown below):
-{{{ 
-{{{   &lt;smtpserver-tls enabled="true"&gt; }}}
-{{{      &lt;!-- port 465  is the well-known/IANA registered port for SMTPS 
--&gt; }}}
-{{{      &lt;port&gt;465&lt;/port&gt; }}}
-{{{      &lt;useTLS&gt;true&lt;/useTLS&gt; }}}
-{{{   ... }}}
-{{{   &lt;/smtpserver-tls&gt; }}}
- }}}
+{{{
+<smtpserver-tls enabled="true">
+    <!-- port 465  is the well-known/IANA registered port for SMTPS -->
+    <port>465</port>
+    <useTLS>true</useTLS>
+    ...
+</smtpserver-tls>
+}}}
 ----
 Enable the ssl factory section of &lt;server-sockets&gt; (shared with POP3S), 
replacing the &lt;file&gt;
 with the appropriate certificate keystore address and setting the correct 
password.
-{{{ 
-{{{         &lt;factory name="ssl" }}}
-{{{            
class="org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory"&gt; 
}}}
-{{{            &lt;keystore&gt; }}}
-{{{               &lt;file&gt;'''conf/keystore'''&lt;/file&gt; }}}
-{{{               &lt;password&gt;'''secret'''&lt;/password&gt; }}}
-{{{               &lt;type&gt;JKS&lt;/type&gt; }}}
-{{{               &lt;protocol&gt;TLS&lt;/protocol&gt; }}}
-{{{               &lt;algorithm&gt;SunX509&lt;/algorithm&gt; }}}
-{{{               &lt;authenticate-client&gt;false&lt;/authenticate-client&gt; 
}}}
-{{{            &lt;/keystore&gt; }}}
-{{{         &lt;/factory&gt; }}}
- }}}
+{{{
+<factory name="ssl"
+         
class="org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory">
+    <keystore>
+        <file>conf/keystore</file>
+        <password>secret</password>
+        <type>JKS</type>
+        <protocol>TLS</protocol>
+        <algorithm>SunX509</algorithm>
+        <authenticate-client>false</authenticate-client>
+    </keystore>
+</factory>
+}}}
 ----
 The smtpserver-tls service must be declared in assembly.xml (just duplicate 
the existing entry for the smtpserver service and change the name to 
smtpserver-tls):
-{{{ 
-{{{  &lt;block name="smtpserver-tls" 
class="org.apache.james.smtpserver.SMTPServer" &gt; }}}
-{{{    &lt;provide name="James" role="org.apache.mailet.MailetContext"/&gt; }}}
-{{{    &lt;provide name="mailstore" 
role="org.apache.james.services.MailStore"/&gt; }}}
-{{{    &lt;provide name="users-store" 
role="org.apache.james.services.UsersStore"/&gt; }}}
-{{{    &lt;provide name="sockets" }}}
-{{{             
role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/&gt; }}}
-{{{    &lt;provide name="connections" }}}
-{{{             
role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"/&gt; 
}}}
-{{{    &lt;provide name="James" 
role="org.apache.james.services.MailServer"/&gt; }}}
-{{{    &lt;provide name="thread-manager" }}}
-{{{             
role="org.apache.avalon.cornerstone.services.threads.ThreadManager" /&gt; }}}
-{{{  &lt;/block&gt; }}}
- }}}
+{{{
+<block name="smtpserver-tls" class="org.apache.james.smtpserver.SMTPServer">
+    <provide name="James" role="org.apache.mailet.MailetContext"/>
+    <provide name="mailstore" role="org.apache.james.services.MailStore"/>
+    <provide name="users-store" role="org.apache.james.services.UsersStore"/>
+    <provide name="sockets"
+             
role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>
+    <provide name="connections"
+             
role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"/>
+    <provide name="James" role="org.apache.james.services.MailServer"/>
+    <provide name="thread-manager"
+             
role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
+</block>
+}}}
 ----
 Also add this to environment.xml to get log files (set the log-level as 
appropriate) (just duplicate the existing entry for the smtpserver category and 
change the name to smtpserver-tls):
-{{{ 
-{{{      &lt;category name="smtpserver-tls" log-level="DEBUG"&gt; }}}
-{{{        &lt;log-target id-ref="smtpserver-target"/&gt; }}}
-{{{      &lt;/category&gt; }}}
- }}}
+{{{
+<category name="smtpserver-tls" log-level="DEBUG">
+    <log-target id-ref="smtpserver-target"/>
+</category>
+}}}
 In this example the log target is shared with smtpserver.
 
 ----
@@ -113,39 +113,39 @@
 
 ----
 In config.xml, setup a different service for ssl/tls, using port 995 (just 
duplicate the existing entry for the pop3server service, change the name to 
pop3server-tls and change the entries as shown below):
-{{{ 
-{{{   &lt;pop3server-tls enabled="true"&gt; }}}
-{{{      &lt;!-- port 995 is the well-known/IANA registered port for POP3S ie 
over SSL/TLS --&gt; }}}
-{{{      &lt;port&gt;995&lt;/port&gt; }}}
-{{{      &lt;useTLS&gt;true&lt;/useTLS&gt; }}}
-{{{   ... }}}
-{{{   &lt;/pop3server-tls&gt; }}}
- }}}
+{{{
+<pop3server-tls enabled="true">
+<!-- port 995 is the well-known/IANA registered port for POP3S ie over SSL/TLS 
-->
+    <port>995</port>
+    <useTLS>true</useTLS>
+    ...
+</pop3server-tls>
+}}}
 ----
 Enable the ssl factory section of &lt;server-sockets&gt;, shared with SMTPS 
(see the SMTPS example above).
 
 ----
 The pop3server-tls service must be declared in assembly.xml (just duplicate 
the existing entry for the pop3server service and change the name to 
pop3server-tls):
-{{{ 
-{{{  &lt;block name="pop3server-tls" 
class="org.apache.james.smtpserver.SMTPServer" &gt; }}}
-{{{    &lt;provide name="mailstore" 
role="org.apache.james.services.MailStore"/&gt; }}}
-{{{    &lt;provide name="users-store" 
role="org.apache.james.services.UsersStore"/&gt; }}}
-{{{    &lt;provide name="sockets" }}}
-{{{             
role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/&gt; }}}
-{{{    &lt;provide name="connections" }}}
-{{{             
role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"/&gt; 
}}}
-{{{    &lt;provide name="James" 
role="org.apache.james.services.MailServer"/&gt; }}}
-{{{    &lt;provide name="thread-manager" }}}
-{{{             
role="org.apache.avalon.cornerstone.services.threads.ThreadManager" /&gt; }}}
-{{{  &lt;/block&gt; }}}
- }}}
+{{{
+<block name="pop3server-tls" class="org.apache.james.smtpserver.SMTPServer" >
+    <provide name="mailstore" role="org.apache.james.services.MailStore"/>
+    <provide name="users-store" role="org.apache.james.services.UsersStore"/>
+    <provide name="sockets"
+             
role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>
+    <provide name="connections"
+             
role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"/>
+    <provide name="James" role="org.apache.james.services.MailServer"/>
+    <provide name="thread-manager"
+             
role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
+</block>
+}}}
 ----
 Also add this to environment.xml to get log files (set the log-level as 
appropriate) (just duplicate the existing entry for the pop3server category and 
change the name to pop3server-tls):
-{{{ 
-{{{      &lt;category name="pop3server-tls" log-level="DEBUG"&gt; }}}
-{{{        &lt;log-target id-ref="pop3server-target"/&gt; }}}
-{{{      &lt;/category&gt; }}}
- }}}
+{{{
+<category name="pop3server-tls" log-level="DEBUG">
+    <log-target id-ref="pop3server-target"/>
+</category>
+}}}
 In this example the log target is shared with pop3server.
 
 ----
@@ -159,16 +159,18 @@
 
 == Preparing the Certificate Keystore ==
 
-(Adapted from the Tomcat 4.1 documentation) 
+(Adapted from the Tomcat 4.1 documentation)
 
-James currently operates only on JKS format keystores. This is Java's standard 
"Java KeyStore" format, and is the format created by the keytool command-line 
utility. This tool is included in the JDK. 
+James currently operates only on JKS format keystores. This is Java's standard 
"Java KeyStore" format, and is the format created by the keytool command-line 
utility. This tool is included in the JDK.
 
-To import an existing certificate into a JKS keystore, please read the 
documentation (in your JDK documentation package) about keytool. 
+To import an existing certificate into a JKS keystore, please read the 
documentation (in your JDK documentation package) about keytool.
 
 To create a new keystore from scratch, containing a ''single self-signed 
Certificate'', execute the following from a terminal command line:
 
- <code>keytool -genkey -alias james -keyalg RSA -keystore 
&lt;your_keystore_filename&gt;</code>
-{{{   }}}
+{{{
+keytool -genkey -alias james -keyalg RSA -keystore <your_keystore_filename>
+}}}
+
 (The RSA algorithm should be preferred as a secure algorithm, and this also 
ensures general compatibility with other servers and components.)
 
 As a suggested standard, create the keystore in the james/conf directory (the 
same containing sqlResources.xml), with a name like 
<code>james.keystore</code>. Any name and location though is fine, as long as 
is the same as in the &lt;file&gt; of the ssl factory section of 
&lt;server-sockets&gt; in config.xml.
@@ -189,7 +191,7 @@
 
 == Installing a Certificate from a Certificate Authority ==
 
-(Adapted from the Tomcat 4.1 documentation) 
+(Adapted from the Tomcat 4.1 documentation)
 
 To obstain and install a Certificate from a Certificate Authority (like 
verisign.com, thawte.com or trustcenter.de) you should have read the previous 
section and then follow these instructions:
 
@@ -198,13 +200,14 @@
 In order to obtain a Certificate from the Certificate Authority of your choice 
you have to create a so called Certificate Signing Request (CSR). That CSR will 
be used by the Certificate Authority to create a Certificate that will identify 
your James server as "secure". To create a CSR follow these steps:
 
 Create a local Certificate as described in the previous section.
-{{{    }}}
-The CSR is then created with: 
-{{{    }}}
- <code>keytool -certreq -keyalg RSA -alias james -file certreq.csr -keystore 
&lt;your_keystore_filename&gt;</code>
-{{{   }}}
+
+The CSR is then created with:
+{{{
+keytool -certreq -keyalg RSA -alias james \
+        -file certreq.csr -keystore <your_keystore_filename>
+}}}
 Now you have a file called certreq.csr. The file is encoded in PEM format. You 
can submit it to the Certificate Authority (look at the documentation of the 
Certificate Authority website on how to do this). In return you get a 
Certificate.
-{{{  }}}
+
 === Importing the Certificate ===
 
 Now that you have your Certificate you can import it into you local keystore. 
First of all you may have to import a so called Chain Certificate or Root 
Certificate into your keystore (the major Certificate Authorities are already 
in place, so it's unlikely that you will need to perform this step). After that 
you can procede with importing your Certificate.
@@ -216,12 +219,17 @@
  For Trustcenter.de go to: 
http://www.trustcenter.de/certservices/cacerts/en/en.htm#server
  For Thawte.com go to: http://www.thawte.com/certs/trustmap.html (seems no 
longer valid)
 
-Import the Chain Certificate into you keystore 
-{{{    }}}
- <code>keytool -import -alias root -keystore &lt;your_keystore_filename&gt; 
-trustcacerts -file &lt;filename_of_the_chain_certificate&gt;</code>
+Import the Chain Certificate into you keystore
 
+{{{
+keytool -import -alias root -keystore <your_keystore_filename> \
+        -trustcacerts -file <filename_of_the_chain_certificate>
+}}}
 ==== Importing the requested Cerificate ====
 
-And finally import your new Certificate (It must be in X509 format): 
-{{{    }}}
- <code>keytool -import -alias james -keystore &lt;your_keystore_filename&gt; 
-trustcacerts -file &lt;your_certificate_filename&gt;</code>
+And finally import your new Certificate (It must be in X509 format):
+
+{{{
+keytool -import -alias james -keystore <your_keystore_filename> \
+        -trustcacerts -file <your_certificate_filename>
+}}}

Reply via email to