全部博文(89)
分类: LINUX
2011-11-15 16:07:07
Note: OpenSSL >1.0.0a will be included in future Linux distros (such as Ubuntu Oneiric). If you already have a recent enough OpenSSL, this section can be skipped.
如果0.9.8a、0.9.8e、0.9.8g下载补丁
不打补丁,openssl pkcs12 命令参数中缺少 -CSP 和 -LMK,最后生成cert.p12私钥时报错
There is a patch on the site mentioned above that enables OpenSSL to create certificates so that they are accepted by Windows for the LDAPS service. However, recent versions of OpenSSL now support this natively.
Compiling OpenSSL on Linux is straightforward:
Make sure you have a functioning build environment for this (on Debian based systems you could do anapt-get install build-essential before).
This will install the latest OpenSSL in /usr/local/ssl which is good since you probably do not want to mess with your existing OpenSSL installation.
Creating the certificateI recommend using the from the extremely helpful site I mentioned above. Just make sure it uses your new OpenSSL config and binary:
Open the script in an editor to check if you want to change some of the parameters (such as certificate validity period). Then add this section to /usr/local/ssl/openssl.cnf:
This mainly adds the extended key usage required by Windows. (Credit, again, goes to Stephen Pillinger’s site linked above.)
Finally, OpenSSL needs a CA to sign your new certificates. Quickly create one like this:
What you enter here is mostly arbitrary. I used the FQDN of the windows server as the CN.
You’re now ready to run the script:
Be careful to enter the fully qualified domain name (hostname plus domain) of your Windows server as the Common Name (CN). Confirm signing and storing the certificate.
Also, export the CA certificate for importing it into Windows:
Have the cert.p12 and ca.crt files available somewhere where your Windows server can access them.
Install the certificate for LDAPS authentication:
Install the CA certificate:
You should now restart the Active Directory Domain Services. (Not sure this step is really neccessary.)
TestingYou can test locally using the ldp.exe tool. Choose Connect, set the FQDN of your LDAPS server, 636 as a port and activate the With SSL checkbox. You should see output similar to this:
…followed by some information about the LDAP service.
It should now be possible for external apps to authenticate users by querying this LDAP server using SSL.
参考链接: