Building Your PKI
e.g. tar zxvf xxxx.tar.gz
csh> cd mod_ssl-xxxxxx csh> ./configure --with-apache=../apache_xxxxx --with-ssl=../openssl-xxxxx csh> cd ../apache_xxxxx csh> make certificate TYPE=dummy csh> make install
Using configuration from /usr/local/ssl/openssl.cnf Enter PEM pass phrase: You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:HK State or Province Name (full name) [Some-State]:Hong Kong Locality Name (eg, city) []:Hong Kong Organization Name (eg, company) [Internet Widgits Pty Ltd]:CUHK Organizational Unit Name (eg, section) []:NTEC Common Name (eg, YOUR name) []:xxxx.wsh.hkntec.net Email Address []:root@xxxx.wsh.hkntec.net Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:
./new-root-ca.sh Enter PEM pass phrase: Verifying password - Enter PEM pass phrase: Self-sign the root CA... Using configuration from root-ca.conf Enter PEM pass phrase: You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [MY]:HK State or Province Name (full name) [Perak]:Hong Kong Locality Name (eg, city) [Sitiawan]:Shatin Organization Name (eg, company) [My Directory Sdn Bhd]:CUHK Organizational Unit Name (eg, section) [Certification Services Division]:ntec Common Name (eg, MD Root CA) []:ntec CA Email Address []:root@hkntec.net
Sign the server certificate request you have generated before. E.g.
./sign-server-cert.sh user
After the sign, you should have user.crt file which the server certficate, signed by your CA
ServerAdmin root@xxx.hkntec.net Servername xxxx.xxx.hkntec.net SSLCertificateFile /usr/local/apache/certs/user.crt SSLCertificateKeyFileFile /usr/local/apache/certs/user2.key
./new-user-cert.sh user@xxxx.hkntec.net
./sign-user-cert.sh user@xxxx.hkntec.net
After the sign, you should have three files:
./p12.sh user@xxxx.hkntec.net