diff mod_client_certs.wiki @ 287:1a00ae04a358

Added an example of how to generate your client side certificate with a id-on-xmppAddr field, thanks to Zash for the cnf file.
author thijsalkemade@gmail.com
date Sun, 10 Jun 2012 11:08:09 +0000
parents bc0b13c53b57
children 118f44d63e25
line wrap: on
line diff
--- a/mod_client_certs.wiki	Sat Jun 09 00:03:02 2012 +0200
+++ b/mod_client_certs.wiki	Sun Jun 10 11:08:09 2012 +0000
@@ -9,6 +9,44 @@
 
 Each user can add their own certificates. These do not need to be signed by a trusted CA, yet they do need to be valid at the time of logging in and they should include an subjectAltName with otherName "id-on-xmppAddr" with the JID of the user.
 
+== Generating your certificate ==
+
+ # To generate your own certificate with a "id-on-xmppAddr" attribute using the command line {{{openssl}}} tool, first create a file called {{{client.cnf}}} with contents:
+{{{
+[req]
+prompt = no
+x509_extensions = v3_extensions
+req_extensions = v3_extensions
+distinguished_name = distinguished_name
+
+[v3_extensions]
+extendedKeyUsage = clientAuth
+keyUsage = digitalSignature,keyEncipherment
+basicConstraints = CA:FALSE
+subjectAltName = @subject_alternative_name
+
+[subject_alternative_name]
+otherName.0 = 1.3.6.1.5.5.7.8.5;FORMAT:UTF8,UTF8:hamlet@shakespeare.lit
+
+[distinguished_name]
+commonName = Your Name
+emailAddress = hamlet@shakespeare.lit
+}}}
+ # Replace the values for {{{otherName.0}}} and {{{commonName}}} and {{{emailAddress}}} with your own values. The JID in {{{otherName.0}}} can either be a full JID or a bare JID, in the former case, the client can only use the resource specified in the resource. There are many other fields you can add, however, for SASL EXTERNAL, they will have no meaning. You can add more JIDs as {{{otherName.1}}}, {{{otherName.2}}}, etc.
+ # Create a private key (as an example, a 4096 bits RSA key):
+{{{
+openssl genrsa -out client.key 4096
+}}}
+ # Create the certificate request:
+{{{
+openssl req -key client.key -new -out client.req -config client.cnf -extensions v3_extensions
+}}}
+ # Sign it yourself:
+{{{
+openssl x509 -req -days 365 -in client.req -signkey client.key -out client.crt -extfile client.cnf -extensions v3_extensions
+}}}
+ The 365 means the certificate will be valid for a year starting now.
+
 = Configuration =
 
 (None yet)