
VMware, Inc. 31
Chapter 4 Securing ADM
To create a certificate
1TogeneratetheRivest,Shamir,andAdleman(RSA)keytype:
cd /etc/httpd/conf/ssl.prm/
openssl genrsa 2048 > server.key
chmod 400 server.key
TheopenSSLutilitycangenerateaDigitalSignatureAlgorithm(DSA)keybyusingthegendsaoption.
Forcompatibility,VMwarerecommendsRSAkeysbyusing2048‐bitsasthekeysize.
2 Createthecertificatebytyping:
openssl req -new -x509 -nodes -sha1 -days 365 -key server.key > server.crt
The-new,-x509,and-nodesargumentsarerequiredtocreateanunencryptedcertificate.The-days
argumentspecifiesthelengthoftimethecertificateisvalid.
Forencryptedcertificates,everytimeyouarerequiredtotypethepassworduntilthekeyisloaded.
YoucanaskquestionstocompleteX.509attributescertificate.Adjusttheanswerstoyourlocalsettings.If
frequentlytyped,youcanupdatethesystemopenssl.cnffile(inthe/usr/share/ssl/directory)withthe
correctdefaults.
Table 4‐1listsX.509attributesamplepromptsandanswers.
Forwebservices,thecommonnamefieldmustexactlymatchthehostname(orVIPname,forhosts
associated
withaloadbalancer)ofthesystemcertificateisusedon;otherwise,acertificatetohostnamemismatchcan
occur.Inpeer‐to‐peersetupsforAS2,thisfieldcanusuallybesettoadescriptivestring.
Thecertificatedataintheserver.crtfilemustbetransferredtoallclientsystems
thatneedtoverifythekey
oftheservertowhichitisconnected.Ifthismethoddoesnotscale,setupaCA,anddistributethesigning
certificatetotheclientsinsteadofeachself‐signedcertificate.Optionally,youcanextractthemetadata.
Copying the .key and .crt Files
Typethefollowingcommandstocopythe.keyand.crtfiles:
cp server.crt /etc/httpd/conf/ssl.crt
cp server.key /etc/httpd/conf/ssl.key
Tomakethecertificateeffective,restarttheApacheservicebytyping
adm_control.pl --restart apache
NOTEInmostcases,encryptedcertificatesarenotworththeoperationalburden,aseachprocessrestart
orsystemrestartrequiresyoutomanuallytypeapassword.
Table 4-1. X.509 Sample Prompts and Answers
Prompt Answer
Countryname(2lettercode)[AU]: US
Stateorprovincename(fullname)[Some‐State]: Massachusetts
Localityname(eg,city)[]: Boston
Organizationname(forexample,company)[InternetWidgitsPtyLtd]: YourCompanyOrg
Organizationalunitname(forexample,section)[]: ‐
Commonname(forexample,YOURname)[]: hostname.domain
E‐mailaddress[]: postmaster@yourcompany.org
Commentaires sur ces manuels