[Top] [Prev] [Next] [Last]
|
|
Chapter 2Authentication and Encryption
- encrypting private information
- authenticating sites and clients with X.509 certificates
This chapter discusses authentication and encryption topics:
- SSL and TLS
- encryption
- authentication
- site certificates and keys
- client authentication
- proxy authentication
- private certification authorities
- using the server security utilities
SSL and TLS
Transport Layer Security (TLS)
- an open, standards-based solution,
- more non-proprietary ciphers,
- better error reporting, and
- HMAC digests instead of MD5.
You can find specifications and other detailed information about TLS at http://www.ietf.org/html.charters/tls-charter.html. Although few clients support it now, TLS is expected to be intergrated into many client products in the near future. In particular, the Mozilla Crypto Group is integrating SSLeay, including TLS support, into Netscape's newly released browser source code. For information about this project, see http://mozilla-crypto.ssleay.org/.
Enabling SSL or TLS
SSLFlag on
This directive enables encryption and site authentication functions. (Client authentication is optional and must be configured separately). The SSLProtocol directive is also required, to specify which security protocols are enabled. Stronghold Web Server supports SSL version 2, SSL version 3, and TLS version 1. SSLProtocol can enable one, two, or all three of them. For example:
- to enable all protocols
SSLProtocol all
- to enable all protocols except TLS
SSLProtocol all -TLSv1
- to enable SSL version 3 and TLS version 1
SSLProtocol SSLv3 TLSv1
The complete list of SSL/TLS directives appears in Chapter 7.
Encryption
Ciphers fall into two categories:
- Public key ciphers require two keys: a public key and a private key. The public key encrypts data, but it cannot decrypt the same data. Only the private key can decrypt data that is encrypted with the public key.
Figure 2-1: Encryption and Decryption with Public Key Cryptography
- Symmetric ciphers use a single key for all operations. Under this scheme, the sender and the recipient share the same key and use it for both encryption and decryption.
Figure 2-2: Encryption and Decryption with Symmetric Cryptography
Figure 2-3: Session Key Exchange
Generating an Encryption Key Pair
- generates a key pair for any host,
- calls genreq to generate a certificate signing request (CSR), and then
- calls gencert to create a temporary certificate.
Genkey runs automatically during server installation to create keys and a CSR for the main server host. It must be run separately for each additional host on the server. "Site Certificates and Keys" on page 2-12 provides complete instructions for using this utility.
Controlling Stronghold's Ciphers
- the size of the key it uses,
- its endurance under the scrutiny of cryptographers, and
- the complexity of its mathematical algorithm.
To see a list of the available ciphers, run the following command:
# ssleay ciphers -v
- SSLCipherList and SSLProxyCipherList apply only to a virtual host and to all objects on that host . It performs the same function as SSLRequireCipher, but only applies to hosts and any objects that are not separately configured with SSLRequireCipher.
- SSLRequireCipher specifies ciphers that are required for access to an object. Use this directive to configure exceptions to SSLCipherList and SSLProxyCipherList.
- SSLBanCipher specifies ciphers that are forbidden for access to an object.
The value for each of these directives is a colon-separated list of ciphers. Use the cipher abbreviations shown in the table above. SSLCipherList can also take a number of cipher aliases as values, shown in the table on page 7-110. For example, the following configuration allows three different ciphers for access to the virtual host (and its /about directory), but only two for access to its /employees directory:
<VirtualHost www.mpp.org:443>
SSLFlag on
SSLCipherList DES-CBC3-MD5:DES-CBC3-SHA:RC4-MD5
<Directory /about>
FancyIndexing on
</Directory>
<Directory /employees>
SSLRequireCipher DES-CBC3-MD5
SSLRequireCipher DES-CBC3-SHA
</Directory>
</VirtualHost>
The same effect could be achieved by using
SSLBanCipher RC4-MD5
instead of the two SSLRequireCipher directives.
NOTE: Use either SSLRequireCipher or SSLBanCipher. Never use both for the same object.
Authentication
- information about its format
- a serial number
- information about the algorithm used to sign the certificate
- the name of the CA that issued the certificate
- the validity period of the certificate
- identifying information about the "subject," or the entity to whom the certificate belongs
- the subject's public key
- the issuing CA's signature
- the certificate belongs to the entity that provided it,
- the public key in the certificate belongs to the same entity,
- the certificate and the public key have been validated by the CA whose name appears on the certificate, and
- no one has tampered with the certificate.
Once an entity is authenticated, its public key can safely be used to encrypt subsequent network transactions, including the crucial session key exchange described on page 2-5.
Stronghold Web Server supports three different kinds of certificates:
- CA certificates contain the public keys used to check the signatures on other certificates.
CAs have different certificates for validating client certificates and site certificates. Stronghold comes with a set of default CA certificates from popular, independent CAs. To install additional CA certificates for client authentication, see "Installing New Client CA Certificates" on page 2-16. To install additional CA certificates for remote server authentication during proxy transactions, see "Remote Server Authentication" on page 2-19.
- Site certificates authenticate Stronghold to clients.
- Client certificates authenticate clients to Stronghold. During proxy transactions, Stronghold uses its own client certificates to authenticate itself to remote servers.
Independent Certification Authorities
- Verisign: http://www.verisign.com/
- Thawte Consulting: http://www.thawte.com/
Each of these offers site certificates and client certificates to the general public for a fee. If Stronghold Web Server is running over the World Wide Web, each host on the server must have a site certificate signed by one of these CAs in order to attain credibility when performing secure transactions. Likewise, it's a good idea to accept only client certificates signed by these CAs, unless you choose to run your own private CA as described in "Private Certification Authorities" on page 2-11.
For policy information and current rates, consult the Web site of the CA you intend to petition for a certificate. If you have purchased the Stronghold/Thawte bundle, see "Acquiring a New Certificate and Key Pair" on page 2-12 for information about obtaining your Thawte certificate.
Private Certification Authorities
"Private Certification Authorities" on page 2-20 explains how to create and run a private Certification Authority.
Site Certificates and Keys
- Certificates are stored in ServerRoot/ssl/certs/hostname.cert.
- Private key files are stored in ServerRoot/ssl/private/hostname.key.
This section explains how to acquire, install, and manage site certificates and key pairs.
Acquiring a New Certificate and Key Pair
Figure 2-4: Key Pair and Certificate Generation
NOTE: Since browsers do not recognize your site as a trusted CA, the temporary certificate provides no authentication. A client that encounters a temporary certificate passes a warning to the user. You must acquire a certificate from a trusted CA in order to conduct secure transactions over the Web.
Stronghold Web Server's installation program also runs genkey as part of the setup sequence. "Generating a New Key Pair and Requesting a New Certificate" on page 2-27 provides complete instructions for using genkey. Genreq can be run separately, as described in "Requesting a New Certificate for an Existing Key Pair" on page 2-38. Gencert can also be run separately, as described in "Generating a Test Certificate" on page 2-38.
When a CA returns a new site certificate, Stronghold's getca utility installs it as ServerRoot/ssl/certs/hostname.cert. This file-naming scheme keeps site certificates organized, since the server may support many virtual hosts, each with its own site certificate. See "Installing a Site Certificate" on page 2-39 for full getca instructions.
Renewing an Expired Certificate
Site certificates are generally issued and billed for one-year periods. Stronghold notifies the server administrator via email when a site certificate is about to expire. When this happens, use the genreq utility to request a new certificate. The CA sends a new certificate and bills you for another year. For full instructions, see "Requesting a Renewed Certificate" on page 2-34.
The new certificate is identical to the original, except for its expiration date. After moving the old certificate, install the new one as described in "Installing a Site Certificate" on page 2-39. The original key pair works with the new certificate; do not generate a new one.
Troubleshooting Mismatched Certificates and Keys
RSA decrypt error - i=-1 enc_bits=5
If you receive this error, or you are otherwise unsure that a host's certificate file matches its key file, use Stronghold's checkcert utility to compare the two files. See "Comparing Certificates and Key Pairs" on page 2-37 for complete instructions.
Client Authentication
Users can obtain client certificates from an independent CA or a private CA. Client certificates issued by major CAs are designed to provide authentication that any secure server can accept. Stronghold recognizes client certificates signed by Verisign and Thawte. To accept other CAs, including private CAs, see "Installing New Client CA Certificates" on page 2-16.
Controlling Access with Client Certificates
SSLVerifyClient indicates whether a client certificate is required in order to access a host. It has three possible values:
Value Description 0 A client certificate is not required 1 A client certificate is optional 2 A client certificate is required Access control with client certificates is enabled when
- SSLVerifyClient is set to 2 and
- the SSL_Require directive is set.
SSL_Require sets the criteria used to accept or reject client certificates. A client certificate must meet these criteria in order to receive the requested material. This directive's value can be
- "any," meaning that any valid certificate is acceptable
- "none," meaning that no certificate is acceptable
- an expression that specifies the content or format of an acceptable certificate
An SSL_Require expression can specify any parameter that client certificates contain. For example, it can specify only certificates that belong to clients in Denmark, were issued by your private CA, contain public keys larger than 512 bits, have previously been logged by the server, or belong to Sameer Parekh. The complete rules for building SSL_Require expressions appear on page 7-97.
SSL_Group is a related directive that creates client authentication groups whose members all meet the same criteria. Its valid values are identical to those for SSL_Require, except that the certificate criteria is preceded by a group name. The group name can be used as the value for SSL_Require, specifying that the certificate must meet the criteria for that group. If the same client certificate criteria is used for many different objects, SSL_Group provides a convenient shortcut.
Installing New Client CA Certificates
There are two ways to install a CA certificate:
- append the certificate to the SSLCACertificateFile file
- save the certificate file in the SSLCACertificatePath directory
To append a CA certificate to the root file
- Make sure the new CA certificate is in PEM format.
- Switch to the ServerRoot/ssl/CA/ directory:
# cd ServerRoot/ssl/CA
- Append the new CA certificate to the existing certificate file:
# cat newcert.pem >> client-rootcerts.pem
- If you are installing a certificate chain, repeat these steps for each certificate in the chain.
To save a CA certificate in the CA directory
- Make sure the new CA certificate is in PEM format.
- Copy the certificate file to the ServerRoot/ssl/CA/ directory:
# cp newcert.pem ServerRoot/ssl/CA/newcert.pem
- Switch to the ServerRoot/ssl/CA/ directory.
- Create a hash of the certificate file using the ssleay x509 utility:
# ssleay x509 -hash -noout < newcert.pem
5a35be
- Rename the certificate according to its hash:
# mv newcert.pem 5a35be.0
# ln -s newcert.pem 5a35be.0
- If you are installing a certificate chain, repeat these steps for each certificate in the chain.
Proxy Authentication
- Normal proxy service (configured with ProxyRequests) uses the CONNECT protocol. Normal proxy service passes the browser's client certificate to the remote server during SSL and TLS transactions. The remote server then authenticates the browser and not the proxy server. The browser verifies the remote server's site certificate.
- Mirror proxy service (configured with ProxyPass) uses two separate SSL or TLS connections when the browser specifies the HTTPS protocol: one connection between the browser and the proxy, and one between the proxy and the remote server. Under this configuration, the proxy server verifies the remote server's site certificate, and the remote server may require a proxy client certificate from the proxy server.
Proxy Client Certificates
NOTE: Never use any client certificate other than one specifically intended for the proxy server. If you use a personal client certificate, other users can use the proxy server to access secure sites that accept your certificate.
- perform all SSLor TLS proxy transactions using a normal proxy configuration or
- request a proxy client certificate from a private CA.
Remote servers on the Internet may not accept proxy client certificates issued by a private CA, because they do not have the CA's certificate on file and have no means of verifying the signature. A proxy client certificate from a private CA works best on a private network where all servers are configured to recognize the private CA. For more information, see "Private Certification Authorities" on page 2-20.
Once you have obtained a proxy client certificate, you must use SSLProxyMachineCertPath or SSLProxyMachineCertFile to set its location. If you have multiple proxy client certificates, you can store them in separate files in the SSLProxyMachineCertPath, or append them to the SSLProxyMachineCertFile.
Remote Server Authentication
- RSA Data Security
- Verisign
- Thawte Consulting
There are two ways to install a CA certificate:
- append the certificate to the SSLProxyCACertificateFile file
- save the certificate file in the SSLProxyCACertificatePath directory
To append a CA certificate to the root file
- Make sure the new CA certificate is in PEM format.
- Switch to the ServerRoot/ssl/CA/ directory:
# cd ServerRoot/ssl/CA
- Append the new CA certificate to the existing certificate file:
# cat newcert.pem >> server-rootcerts.pem
- If you are installing a certificate chain, repeat these steps for each certificate in the chain.
To save a CA certificate in the CA directory
- Make sure the new CA certificate is in PEM format.
- Copy the certificate file to the ServerRoot/ssl/CA/ directory:
# cp newcert.pem ServerRoot/ssl/CA/newcert.pem
- Switch to the ServerRoot/ssl/CA/ directory.
- Create a hash of the certificate file using the ssleay x509 utility:
# ssleay x509 -hash -noout < newcert.pem
5a35be
- Rename the certificate file according to its hash:
# mv newcert.pem 5a35be.0
# ln -s newcert.pem 5a35be.0
- If you are installing a certificate chain, repeat these steps for each certificate in the chain.
Private Certification Authorities
- Consult a security expert before building your own CA.
- Do not connect the computer that houses the CA to a network.
- Reserve login access for those who absolutely require it.
- Restrict physical access to the CA by keeping it in a tightly locked room.
- Equip the CA with an RF shield to protect it from radio-frequency surveillance.
- Never store the CA key file unencrypted.
- Instruct your users to generate key pairs of adequate size, preferably 1024-bit.
- create the CA
- configure SSLeay
- distribute the certificate
- set up a CSR service
You also have the option to use Xcert Sentry in tandem with Stronghold Web Server. Xcert Sentry is a sophisticated private-CA tool that includes a Stronghold module, Lightweight Directory Access Protocol (LDAP) support, and an easy-to-use graphical interface. If you want to certify clients as well as servers, you must use Sentry. For more information, see http://www.xcert.com/.
Setting Up a CA
To create a private CA
- Run the makeca utility:
# makeca
- Enter the key size in bits.
NOTE: Keys sizes must be either 512 or 1024 for compatibility with certain browsers. We recommend 1024 bits. Keys larger than 1024 bits are incompatible with some versions of Netscape Navigator and Microsoft Internet Explorer, and with other browsers that use RSA's BSAFE cryptography toolkit.
- Tap out some random keystrokes.
0 * -Enough, thank you.
- Enter the two-letter code for your country.
This is the same two-letter code used in hostnames in your country, such as DE for Germany or JP for Japan. For the complete list of valid country codes, see Appendix D.
- Enter the full name of your state or province.
- Enter the name of your city, town, or other locality.
- Enter the name of your organization.
- Enter the name of your unit within the organization.
- Enter the domain name of your site.
Once the Certification Authority has been built, you need to
- publish the CA's certificate within your organization
# ssleay x509 -outform DER < ServerRoot/ssl/CA/cacert.pem > ServerRoot/htdocs/myca.cacert
- instruct users to install the certificate in their browsers
Configuring SSLeay
The policy field gives the name of the current CA policy:
policy = policy_match
# For the CA policy
[ policy_match ]
countryName = match
stateOrProvinceName = match
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
# For the 'anything' policy
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
Signing Certificates
# ssleay req -text -noout < CSRfilename
The program prints the CSR in plaintext.
To sign a certificate
- Save the CSR to a temporary file such as /tmp/csr.
- Run sign_csr:
# sign_csr /tmp/csr
- Press Return.
- Enter the CA pass phrase that you set when you ran makeca.
The program checks the signature on the request, then prints the request fields:
Check that the request matches the signature
Signature ok
The Subjects Distinguished Name is as follows
countryName :PRINTABLE:'US'
stateOrProvinceName :PRINTABLE:'California'
localityName :PRINTABLE:'Oakland'
organizationName :PRINTABLE:'C2Net'
organizationalUnitName:PRINTABLE:'Testing/QA'
commonName :PRINTABLE:'test7.c2.net'
Certificate is to be certified until Mar 31 22:19:53 1998 GMT (365 days)
Sign the certificate? [y/n]:
The expiration date is based on the default_days field in ssleay.conf.
- Enter "Y" to sign the certificate or N to abort.
The program prompts you to commit the signature:
1 out of 1 certificate requests certified, commit? [y/n]
- Enter "Y" to commit or "N" to abort.
- Return the newly-signed certificate to the applicant-for example, as an email attachment.
Security Utilities
- changing the pass phrase
- decrypting a private key
- generating a new key pair and requesting a new certificate
- requesting a renewed certificate
- comparing certificates and key pairs
- requesting a new certificate for an existing key pair
- generating a test certificate
- installing a certificate
- creating a private Certification Authority
- converting a Netscape Commerce certificate to a Stronghold-compatible format
- viewing the contents of a certificate
- administering basic authentication
To add the utilities directory to the PATH variable
- Edit the PATH variable according to the type of UNIX shell you are using:
- From the Bourne shell, Korn shell, or bash, add this line to the root .profile file:
PATH=ServerRoot/bin:$PATH
- If you are using the C shell or tcsh, add this line to the root .cshrc file:
set path=(ServerRoot/bin $PATH)
Be sure to replace ServerRoot with the actual path to your root server directory.
- Save the file.
Changing the Pass Phrase
The change_pass utility changes the pass phrase used to encrypt the private key for a host:
# bin/change_pass hostname
Decrypting a Private Key
The decrypt_key utility decrypts the private key for a host:
# bin/decrypt_key hostname
Generating a New Key Pair and Requesting a New Certificate
The genkey utility generates a public/private key pair, generates a certificate signing request, and generates a test certificate for use in the interim. This section provide complete instructions for using genkey to generate a key pair and request a signed certificate from Verisign, Thawte, and other CAs.
To generate a key pair and request a Verisign certificate
- Run genkey, specifying the name of the host or virtual host:
# bin/genkey hostname
The key will be stored in
ServerRoot/ssl/private/hostname.key
The certificate stored in
ServerRoot/ssl/certs/hostname.cert
- Press Return.
Genkey reminds you to be sure you are not overwriting an existing key pair and certificate.
- Press Return.
Genkey prompts you to specify the size of the key you want to generate.
- Enter a key size in bits.
NOTE: Keys sizes must be either 512 or 1024 for compatibility with certain browsers. We recommend 1024 bits. Keys larger than 1024 bits are incompatible with some versions of Netscape Navigator and Microsoft Internet Explorer, and with other browsers that use RSA's BSAFE cryptography toolkit.
- Tap out some random keystrokes.
0 * -Enough, thank you.
- Enter "Y" to send a CSR.
Genreq takes over for genkey, and asks you which CA you want to petition for a certificate:
Please choose the CA you would like to use:
A) VeriSign
B) Thawte
C) Other
Choose: A
- Enter "A."
- Enter the two-letter code for your country.
This is the same two-letter code used in hostnames in your country, such as DE for Germany or JP for Japan. For the complete list of valid country codes, see Appendix D.
- Enter the full name of your state or province.
- Enter the name of your city, town, or other locality.
- Enter the name of your organization.
- Enter the name of your unit within the organization.
- Enter the fully-qualified domain name of your site.
The program prints the certificate signing request (CSR), which looks something like this:
-----BEGIN NEW CERTIFICATE REQUEST-----
MIIBEzCBzgIBADB7MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEQ
MA4GA1UEBxMHT2FrbGFuZDEbMBkGA1UEChMSQzJOZXQgU29mdHdhcmUgSW5jMRAw
DgYDVQQLEwdUZXN0aW5nMRYwFAYDVQQDEw1nYWJiZXIuYzIubmV0MEwwDQYJKoZI
hvcNAQEBBQADOwAwOAIxAJukoQhq4LanG2k+/LnRTGJAcgv9LJPsdfCsjqRs8ygo
yaw4ucOEdx+WdnM0x36NcQIDAQABMA0GCSqGSIb3DQEBBAUAAzEABRLR6IkG70oN
G1MnvuMDeWou4kIvc98ysjssCNKsDKsHAXBSEbfsIQs5JRNagVBW
-----END NEWCERTIFICATE REQUEST-----
- Copy the CSR.
- Using your Web browser, access https://digitalid.verisign.com/ss_getCSR.html.
- Paste the CSR into the text box on the Digital ID Enrollment page.
- Click Continue.
- Follow Verisign's online instructions until you complete the enrollment procedure.
- Return to the shell window.
- Enter the two-letter code of your country.
This is the same two-letter code used in hostnames in your country, such as DE for Germany or JP for Japan. For the complete list of valid country codes, see Appendix D.
- Enter the full name of your state or province.
- Enter the name of your organization.
- Enter the name of your unit within the organization.
- Enter the "common name," or fully-qualified domain name, of your server.
- Enter the pass phrase you want to use for this host.
NOTE: Even if you have many hosts, Stronghold Web Server only asks for one pass phrase on startup. For this reason, you should use the same pass phrase for all certificate/key pairs for all hosts.
- Enter the pass phrase again for verification.
To generate a key pair and request a Thawte certificate
- Run genkey, specifying the name of the host or virtual host:
# bin/genkey hostname
The key will be called hostname.key.
The certificate will be called hostname.cert.
They will be stored in /usr/local/www/ssl
- Press Return.
Genkey reminds you to be sure you are not overwriting an existing key pair and certificate.
- Press Return.
Genkey prompts you to specify the size of the key you want to generate.
- Enter a key size in bits.
NOTE: Keys sizes must be either 512 or 1024 for compatibility with certain browsers. We recommend 1024 bits. Keys larger than 1024 bits are incompatible with some versions of Netscape Navigator and Microsoft Internet Explorer, and with other browsers that use RSA's BSAFE cryptography toolkit.
- Tap out some random keystrokes.
0 * -Enough, thank you.
- Enter "Y" to send a CSR.
Genreq takes over for genkey, and asks you which CA you want to petition for a certificate:
Please choose the CA you would like to use:
A) VeriSign
B) Thawte
C) Other
Choose: B
- Enter "B."
- Enter the two-letter code for your country.
This is the same two-letter code used in hostnames in your country, such as DE for Germany or JP for Japan. For the complete list of valid country codes, see Appendix D.
- Enter the full name of your state or province.
- Enter the name of your city, town, or other locality.
- Enter the name of your organization.
- Enter the name of your unit within the organization.
- Enter the fully-qualified domain name of your site.
- Press Return.
- Copy the CSR.
- Using your Web browser, access https://www.thawte.com/cgi-bin/server/step1.sioux.
- Follow Thawte's online instructions until you complete their enrollment procedure.
- Return to the shell window.
- In your shell window, press Return.
- Enter "Y" to confirm that you have successfully completed the Thawte application process.
- Enter the two-letter code of your country.
This is the same two-letter code used in hostnames in your country, such as DE for Germany or JP for Japan. For the complete list of valid country codes, see Appendix D.
- Enter the full name of your state or province.
- Enter the name of your organization.
- Enter the name of your unit within the organization.
- Enter the "common name," or fully-qualified domain name, of your server.
- Enter the pass phrase you want to use for this host.
NOTE: Even if you have many hosts, Stronghold only asks for one pass phrase on startup. For this reason, you should use the same pass phrase for all certificate/key pairs for all hosts.
- Enter the pass phrase again for verification.
To generate a key pair and request a nonstandard certificate
- Run genkey, specifying the name of the host or virtual host:
# bin/genkey hostname
The key will be called hostname.key.
The certificate will be called hostname.cert.
They will be stored in /usr/local/www/ssl
- Press Return.
Genkey reminds you to be sure you are not overwriting an existing key pair and certificate.
- Press Return.
Genkey prompts you to specify the size of the key you want to generate.
- Enter a key size in bits.
NOTE: Keys sizes must be either 512 or 1024 for compatibility with certain browsers. We recommend 1024 bits. Keys larger than 1024 bits are incompatible with some versions of Netscape Navigator and Microsoft Internet Explorer, and with other browsers that use RSA's BSAFE cryptography toolkit.
- Tap out some random keystrokes.
0 * -Enough, thank you.
- Enter "Y" to send a CSR.
Genreq takes over for genkey, and asks you which CA you want to petition for a certificate:
Please choose the CA you would like to use:
A) VeriSign
B) Thawte
C) Other
- Enter "C."
- Enter the email address for certificate requests from your CA.
- Enter the two-letter code of your country.
This is the same two-letter code used in hostnames in your country, such as DE for Germany or JP for Japan. For the complete list of valid country codes, see Appendix D.
- Enter the full name of your state or province.
- Enter the name of your organization.
- Enter the name of your unit within the organization.
- Enter the "common name," or fully-qualified domain name, of your server.
- Enter the email address of this server's administrator.
- Enter the phone number of this server's administrator.
- If the information you entered is correct, press Return to generate the CSR.
If you made a mistake while entering the information, press ^C to exit.
- Accept the default email submission address for the CA you selected, or use a different one.
- To accept the default email address, press Return.
- To use a different address, enter it at the prompt and press Return.
- Enter the two-letter code of your country.
This is the same two-letter code used in hostnames in your country, such as DE for Germany or JP for Japan. For the complete list of valid country codes, see Appendix D.
- Enter the full name of your state or province.
- Enter the name of your organization.
- Enter the name of your unit within the organization.
- Enter the "common name," or fully-qualified domain name, of your server.
- Enter the pass phrase you want to use for this host.
NOTE: Even if you have many hosts, Stronghold Web Server only asks for one pass phrase on startup. For this reason, you should use the same pass phrase for all certificate/key pairs for all hosts.
- Enter the pass phrase again for verification.
Requesting a Renewed Certificate
# bin/genreq hostname
This section contains complete instuctions for requesting a renewed certificate from Verisign, Thawte, and other CAs.
To request a renewed Verisign certificate
- Run genreq:
# bin/genreq hostname
Genreq asks you which CA you want to petition for a certificate:
Please choose the CA you would like to use:
A) VeriSign
B) Thawte
C) Other
Choose: A
- Enter "A."
- Enter the two-letter code for your country.
This is the same two-letter code used in hostnames in your country, such as DE for Germany or JP for Japan. For the complete list of valid country codes, see Appendix D.
- Enter the full name of your state or province.
- Enter the name of your city, town, or other locality.
- Enter the name of your organization.
- Enter the name of your unit within the organization.
- Enter the fully-qualified domain name of your site.
The program prints the certificate signing request (CSR), which looks something like this:
-----BEGIN NEW CERTIFICATE REQUEST-----
MIIBEzCBzgIBADB7MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEQ
MA4GA1UEBxMHT2FrbGFuZDEbMBkGA1UEChMSQzJOZXQgU29mdHdhcmUgSW5jMRAw
DgYDVQQLEwdUZXN0aW5nMRYwFAYDVQQDEw1nYWJiZXIuYzIubmV0MEwwDQYJKoZI
hvcNAQEBBQADOwAwOAIxAJukoQhq4LanG2k+/LnRTGJAcgv9LJPsdfCsjqRs8ygo
yaw4ucOEdx+WdnM0x36NcQIDAQABMA0GCSqGSIb3DQEBBAUAAzEABRLR6IkG70oN
G1MnvuMDeWou4kIvc98ysjssCNKsDKsHAXBSEbfsIQs5JRNagVBW
-----END NEWCERTIFICATE REQUEST-----
- Copy the CSR.
- Using your Web browser, access https://digitalid.verisign.com/ss_getCSR.html.
- Follow Verisign's online instructions for completing the certificate enrollment process.
- In your shell window, press Return.
- Enter "Y" to confirm that you have successfully completed the Verisign application process.
To request a renewed Thawte certificate
- Run genreq:
# bin/genreq hostname
Genreq asks you which CA you want to petition for a certificate:
Please choose the CA you would like to use:
A) VeriSign
B) Thawte
C) Other
Choose: B
- Enter "B."
- Enter the two-letter code for your country.
This is the same two-letter code used in hostnames in your country, such as DE for Germany or JP for Japan. For the complete list of valid country codes, see Appendix D.
- Enter the full name of your state or province.
- Enter the name of your city, town, or other locality.
- Enter the name of your organization.
- Enter the name of your unit within the organization.
- Enter the fully-qualified domain name of your site.
- Press Return.
- Copy the CSR.
- Using your Web browser, access https://www.thawte.com/cgi-bin/server/step1.sioux.
- Follow Thawte's online instructions for completing the certificate enrollment process.
- In your shell window, press Return.
- Enter "Y" to confirm that you have successfully completed the Thawte application process.
To request a renewed, nonstandard certificate
- Run genreq:
# bin/genreq hostname
Genreq asks you which CA you want to petition for a certificate:
Please choose the CA you would like to use:
A) VeriSign
B) Thawte
C) Other
- Enter "C."
- Enter the email address for certificate requests from your CA.
- Enter the two-letter code of your country.
This is the same two-letter code used in hostnames in your country, such as DE for Germany or JP for Japan. For the complete list of valid country codes, see Appendix D.
- Enter the full name of your state or province.
- Enter the name of your organization.
- Enter the name of your unit within the organization.
- Enter the "common name," or fully-qualified domain name, of your server.
- Enter the email address of this server's administrator.
- Enter the phone number of this server's administrator.
- If the information you entered is correct, press Return to generate the CSR.
If you made a mistake while entering the information, press ^C to exit.
- Accept the default email submission address for the CA you selected, or use a different one.
- To accept the default email address, press Return.
- To use a different address, enter it at the prompt and press Return.
Comparing Certificates and Key Pairs
The checkcert utility compares a certificate to the current key pair for a host.
To compare a certificate to a key pair
- Run checkcert, specifying the name of the host whose certificate and key will be checked:
# checkcert hostname
- Enter the pass phrase for this host.
- If the certificate and the key pair match, checkcert prints this message and then exits:
Cert hostname.cert matches key hostname.key
- If the certificate and the key pair do not match, check cert responds like this:
The cert stored in
ServerRoot/ssl/certs/hostname.cert
does not match the key stored in
ServerRoot/ssl/private/hostname.key.
- If the certificate does not match the key file, press Return.
- If there is another key file associated with this host, move it to the ServerRoot/ssl/private/ directory and run checkcert again to see whether that key pair matches the certificate.
- If there is another certificate file associated with this host, move it to the ServerRoot/ssl/certs/ directory and run checkcert again to see whether that certificate matches the key pair.
- If you cannot match a key file with a valid certificate file, use genreq to request a new certificate that matches an existing key file:
# genreq hostname
Requesting a New Certificate for an Existing Key Pair
# bin/genreq hostname
To generate a new key pair for the new certificate, plus a test certificate, use genkey instead.
Generating a Test Certificate
The gencert utility generates a test certificate for a host:
# bin/gencert hostname
Installing a Site Certificate
The getca utility installs a site certificate.
To install a site certificate
- Save the new certificate file in a temporary location, such as /tmp/cert.tmp.
- Run getca, specifying the name of the host that owns this certificate and providing the temporary file as input:
# getca hostname < /tmp/cert.tmp
This saves the certificate to the file ServerRoot/ssl/certs/hostname.cert.
- Restart Stronghold:
# reload-server
The servermust restart in order to implement the new certificate.
Creating a Private Certification Authority
# bin/makeca
Use the key pair to sign certificates in response to CSRs.
After you run makeca, see "Private Certification Authorities" on page 2-20 for detailed instructions on configuring and running your private certification authority.
Converting a Netscape Commerce Certificate and Key Pair
# bin/ns_convert directory hostname
NOTE: Ns_convert cannot convert Netscape Enterprise 2.x certificates.
Viewing the Contents of a Certificate
To view the complete text of a certificate
- Run the x509 utility as an argument to the ssleay command with the -text \xdf ag and the certifi cate fi le as input:
# ServerRoot/bin/ssleay x509 -text -in certfilename
Certificate:
Data:
Version: 1 (0x0)
Serial Number: 0 (0x0)
Signature Algorithm: md5WithRSAEncryption
Issuer: C=US, ST=California, L=Oakland, O=C2Net Software US, OU=Security Services Division, CN=gabber.c2.net
Validity
Not Before: Nov 4 00:30:41 1997 GMT
Not After : Dec 4 00:30:41 1997 GMT
Subject: C=US, ST=California, L=Oakland, O=C2Net Software US, OU=Security Services Division, CN=gabber.c2.net
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public Key: (512 bit)
Modulus (512 bit):
00:bf:2e:73:fe:c1:79:10:ed:25:e4:02:dd:0f:8d:
0a:2a:1b:e7:8d:b7:39:fc:db:a9:00:20:7c:99:6a:
cc:41:a7:a9:41:15:a7:de:81:07:74:d9:69:2b:69:
8e:0c:7d:9b:5d:67:d0:3b:47:55:04:7e:85:c3:2f:
95:4b:19:bb:25
Exponent: 65537 (0x10001)
Signature Algorithm: md5WithRSAEncryption
24:ae:ac:b9:59:9a:88:0d:32:df:c0:05:8c:48:31:6a:a6:2f:
6a:ce:1b:7a:c5:8d:b2:03:bf:0d:63:61:e9:5f:4b:e6:4d:8f:
14:49:8f:36:a4:ca:36:d4:ab:6c:54:26:f7:12:b4:c6:ae:7a:
70:8d:62:10:14:8f:f7:ee:8b:3e
-----BEGIN CERTIFICATE-----
MIICBjCCAbACAQAwDQYJKoZIhvcNAQEEBQAwgY0xCzAJBgNVBAYTAlVTMRMwEQYD
VQQIEwpDYWxpZm9ybmlhMRAwDgYDVQQHEwdPYWtsYW5kMRowGAYDVQQKExFDMk5l
dCBTb2Z0d2FyZSBVUzEjMCEGA1UECxMaU2VjdXJpdHkgU2VydmljZXMgRGl2aXNp
b24xFjAUBgNVBAMTDWdhYmJlci5jMi5uZXQwHhcNOTcxMTA0MDAzMDQxWhcNOTcx
MjA0MDAzMDQxWjCBjTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWEx
EDAOBgNVBAcTB09ha2xhbmQxGjAYBgNVBAoTEUMyTmV0IFNvZnR3YXJlIFVTMSMw
IQYDVQQLExpTZWN1cml0eSBTZXJ2aWNlcyBEaXZpc2lvbjEWMBQGA1UEAxMNZ2Fi
YmVyLmMyLm5ldDBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQC/LnP+wXkQ7SXkAt0P
jQoqG+eNtzn826kAIHyZasxBp6lBFafegQd02WkraY4MfZtdZ9A7R1UEfoXDL5VL
GbslAgMBAAEwDQYJKoZIhvcNAQEEBQADQQAkrqy5WZqIDTLfwAWMSDFqpi9qzht6
xY2yA78NY2HpX0vmTY8USY82pMo21KtsVCb3ErTGrnpwjWIQFI/37os+
-----END CERTIFICATE-----
To view one or more fields of a certificate
- Run ssleay x509 with the -in \xdf ag and one or more of the following fi eld \xdf ags:
For example, run ssleay x509 as follows to view only the beginning date of validity:
# ServerRoot/bin/ssleay x509 -startdate -in certfilename
The x509 utility prints the specifi ed fi eld, followed by the complete, encoded certifi cate:
notBefore=Nov 4 00:30:41 1997 GMT
-----BEGIN CERTIFICATE-----
MIICBjCCAbACAQAwDQYJKoZIhvcNAQEEBQAwgY0xCzAJBgNVBAYTAlVTMRMwEQYD
VQQIEwpDYWxpZm9ybmlhMRAwDgYDVQQHEwdPYWtsYW5kMRowGAYDVQQKExFDMk5l
dCBTb2Z0d2FyZSBVUzEjMCEGA1UECxMaU2VjdXJpdHkgU2VydmljZXMgRGl2aXNp
b24xFjAUBgNVBAMTDWdhYmJlci5jMi5uZXQwHhcNOTcxMTA0MDAzMDQxWhcNOTcx
MjA0MDAzMDQxWjCBjTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWEx
EDAOBgNVBAcTB09ha2xhbmQxGjAYBgNVBAoTEUMyTmV0IFNvZnR3YXJlIFVTMSMw
IQYDVQQLExpTZWN1cml0eSBTZXJ2aWNlcyBEaXZpc2lvbjEWMBQGA1UEAxMNZ2Fi
YmVyLmMyLm5ldDBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQC/LnP+wXkQ7SXkAt0P
jQoqG+eNtzn826kAIHyZasxBp6lBFafegQd02WkraY4MfZtdZ9A7R1UEfoXDL5VL
GbslAgMBAAEwDQYJKoZIhvcNAQEEBQADQQAkrqy5WZqIDTLfwAWMSDFqpi9qzht6
xY2yA78NY2HpX0vmTY8USY82pMo21KtsVCb3ErTGrnpwjWIQFI/37os+
-----CERTIFICATE-----
Administering Basic Authentication
This section provides instructions for using the ServerRoot/bin/htpasswd utility to create a password file, add usernames and passwords, and configure basic authentication access control. The directives that implement basic authentication are described in "Basic Authentication" on page 7-90.
To create a password file
- Create a new directory for password files:
# mkdir ServerRoot/basicauth
- Switch to the ServerRoot/bin/ directory.
- Use the htpasswd utility to create a new password file and add yourself, the administrator, as its first user:
# htpasswd -c ServerRoot/basicauth/filename username
- Enter a new password.
- Re-enter your password for confirmation.
To add a user to a password file
- Switch to the ServerRoot/bin/ directory.
- Run the htpasswd utility, specifying an existing password file and the new username:
# htpasswd ServerRoot/basicauth/filename username
- Have the new user enter the new password.
- Have the new user re-enter the password for confirmation.
To configure basic authentication access control
- Open the httpd.conf file using a text editor.
- Create a container for the object you want to control access to, if one does not already exist. For example:
<Directory ServerRoot/htdocs/secret>
. . .
</Directory>
- Inside the container, insert the AuthType directive and set it to "basic."
<Directory ServerRoot/htdocs/secret>
AuthType basic
. . .
</Directory>
- Insert the Require directive after the AuthType directive and set it to "valid-user."
<Directory ServerRoot/htdocs/secret>
AuthType basic
Require valid-user
. . .
</Directory>
Require user user1 user2 user3
- Insert the AuthUserFile directive after the Require directive and specify the path to the password file:
<Directory ServerRoot/htdocs/secret>
AuthType basic
Require valid-user
AuthUserFile filename
. . .
</Directory>
This designates the password file that Stronghold uses to check usernames and passwords.
- Restart the server:
# ServerRoot/bin/reload-server
Optionally, you can add the AuthName directive, which assigns a name to this authentication realm. The server passes the name of the realm to the client when it requests a username and password. This is useful for distinguishing between multiple basic authentication realms in your domain, particularly if users have different passwords for different realms.
moshpit: deadkennedys minorthreat sexpistols
To use the group file, add the AuthGroupFile directive to the usual set of basic authentication directives, specifying the path to the group file. The basic authentication configuration must also contain one or more AuthUserFile directives specifying the password files that contain the password of members of allowed groups. To allow access by all groups, set the Require directive to "valid-user." To allow access by only certain groups, set it to "group" followed by the list of allowed groups. For example:
Require group moshpit snakepit deeppit
[Top] [Prev] [Next] [Last]
© 1998 C2Net International
Feedback: stronghold-docs@c2.net![]()