Home > Articles > Security > Network Security

Securing LDAP Through TLS/SSL: A Cookbook

Deploying secure Lightweight Directory Access Protocol (LDAP) connections is becoming more demanding. Learn how to set up the Sun Open Net Environment (Sun ONE) Directory Server software so that it can be accessed securely from command line tools.
Like this article? We recommend


Deploying secure Lightweight Directory Access Protocol (LDAP) connections is becoming more demanding as companies choose to build up and maintain a central repository. This article details the steps on how to set up the SunTM Open Net Environment (SunTM ONE) and the SunTM ONE Directory Server software so that it can be accessed securely from command line tools (for example, ldapadd, ldapmodify, or ldapsearch). More precisely, this article describes how client and server authentication can be accomplished with the Sun ONE platform products. In this article, security is accomplished two ways:

  • Transport Layer Security (TLS)/Secure Socket Layer (SSL) Protocol—which provides a mechanism for ensuring the integrity and confidentiality of the transferred data.

  • Authentication based on SSL certificates—which is used to guarantee the identity of the data sources.

This cookbook has been tested with the following products and releases:

  • SolarisTM 8 Operating Environment (updates 07/01, 10/01, and 02/02). Be sure to install the latest patch cluster.

  • Sun ONE Directory Server software (the document has been tested with versions 5.0 and 5.1)

  • The Public Key Cryptographic Standard (PKCS#11) toolkit (the current version is cpkg106.zip)

If you do not have access to a certificate authority (CA) for getting an SSL client and server certificates, you can use the SunTM ONE Certificate Server software (or the publicly available certutil tool). This article uses the Sun ONE Certificate Server software.

The basic steps for securing LDAP with SSL using your own CA are:

  1. Setting up the Directory Server and the Certificate Server (CS).

  2. Generating an SSL server certificate.

  3. Generating an SSL client certificate.

  4. Setting up the appropriate trust-relations.

  5. Enabling SSL for the Sun ONE Directory Server software.

  6. Setting up LDAP/SSL server authentication.

  7. Setting up LDAP/SSL client authentication.

For this article, it is assumed that you have a basic understanding of how certificate-based public-key-cryptography works. Because the certificates are bound to the owner's name, the fictional business of iNIT8 was created for this article. iNIT8 uses the Sun ONE Directory Server Console to set up secure LDAP connections.


All iPlanet products have been rebranded as Sun ONE platform products.

Setting Up the Directory Server and the Certificate Server

You can install both the Sun ONE Directory Server software and the Sun ONE Certificate Server software on the same machine. In production environments, for security reasons, the Sun ONE Certificate Server software is installed on a different machine. The Sun ONE Certificate Server software comes bundled with its own directory server, which holds specific data and can reside on a separate machine depending on your deployment. For the sake of simplicity in this article, all three servers, Sun ONE Directory Server software, Sun ONE Certificate Server software, and the certificate server-specific directory server are installed on the same machine.

In our example, the installation parameters for the Sun ONE Certificate Server software and the bundled directory server are as follows:

Software: certificate-4.2-domestic-us.sparc-sun-solaris2.6.tar.gz

Install location: /opt/iplanet/server4
Directory Service Port: 400
Directory Administration Port: 4000
Computer Name: sunshine.init8.net
Directory Server Identifier: sunshine
Administrator ID: admin 
Password: manager
Directory Manager: cn=Directory Manager
Password: dirmanager
Suffix: o=init8.net


This installation procedure offers you the option to run the Sun ONE software servers under UID nobody and GID nobody. As an even better security practice, pick a unique user/group ID, for example, ldap or cert.

The Sun ONE Directory Server software has the following installation parameters:

Software: directory-5.1-us.sparc-sun-solaris2.8.tar.gz

Install location: /opt/iplanet/server5
Directory Service Port: 389
Directory Administration Port: 3890
Computer Name: sunshine.init8.net
Directory Server Identifier: sunshine
Administrator ID: admin 
Password: manager
Directory Manager: cn=Directory Manager
Password: dirmanager
Suffix: o=iNIT8.net


The suffix o=init8.net in the Sun ONE Directory Server software installation parameters is necessary. Do not use the dc=init8, dc=net suffix. It prevents the mapping defined in the section , "Setting Up LDAP/SSL Client Authentication" from working.

If you already have deployed a Certificate Server, you can skip this section.

Three certificates are needed for setting up a Certificate Authority (CA):

  • CA certificate (freshly generated during setup) to sign SSL certificates

  • SSL server certificate for the Certificate Server to communicate through the browser and SSL with the Certificate Server

  • SSL client certificate for the Certificate Server administrator (CS administrator).

    The SSL client certificate is needed in order to authenticate yourself not only through username/password but by using a public-key method against the Certificate Server.

To Set Up the Certificate Server

  1. Go to /opt/iplanet/server4 and execute startconsole.

  2. Connect to your host at http://sunshine.init8.net:4000 with user ID admin and the password selected during the installation (for example, manager).

    In init8.net you will see sunshine.init8.net and its group of three servers: Certificate Server (cert-sunshine), Administration Server, and Directory Server.

  3. Double-click the Certificate Server (cert-sunshine).

    The Certificate Server realizes that this is your first access and automatically starts up an installation wizard. Do the following:

    1. Create a new internal database:

      Instance ID: sunshine-db
      Port Number: 38900
      Directory Manager DN: cn=Directory Manager
      Password: manager1

      The wizard now creates a new internal database.

    2. Add the following information about the administrator:

      Administrator ID: admin
      Full Name: iNIT 8 Certificate Management System Administrator
      Password: manager1
    3. Click Next.

  4. Select the subsystem by choosing the Certificate Manager

    1. Answering No to the question of whether you want to generate the issuance of Wireless Transportation Layer Security (wTLS) certificates.

    2. Click Next.

    3. Answer No to the question of whether you want the current subsystems to connect to a remote data recovery manager.

    The system now configures the internal database.

  5. Select the range of certificates (for example, 0x1 to 0x200).

  6. (Optional) Enable the Online Certificate Status Protocol (OSCP) service.

  7. Select the ports Sun ONE Certificate Server software will use:

    SSL administration port: 	8200
    SSL agent port:	8100
    SSL end entity port:	 443
    Non-SSL end-entity port:   80 (check enable)
  8. Create a self-signed CA certificate:

    Token: internal
    Password: manager1
    Key type: RSA
    Key length: 1024 bits.

    The system initializes the token.

  9. Select SHA-1 as cryptographic hash algorithm.

  10. Enter the values for the subject Distinguished Name (DN) components of the CA signing certificate.

    This should be done according to your needs. For this example choose the following:

    CN= iNIT8 Certificate Manager
    OU= CERT
    O= iNIT8
    L= Hamburg
    C= DE

    Click Next.

  11. Choose a validity period (for example, two years).

  12. Activate the following extensions:

    CA (Basic Constraints)
    S/MIME CA (Netscape certificate type)
    SSL CA (Netscape certificate type)
    Object-signing CA (Netscape certificate type)
    Authority key identifier
    Subject key identifier
    Key usage
  13. Sign the SSL certificate with your CA signing certificate by choosing the corresponding option in the dialog window.

  14. Choose an internal token and RSA, 1024 Bit. Click Next.

  15. Select SHA-1 as hash algorithm. Click Next.

  16. Enter the following values for the subject DN components:

    CN= sunshine.init8.net
    O= iNIT8
    L= Hamburg
    C= DE

    Click Next.

  17. Select a validity period.

  18. Select the following extensions:

    SSL client (Netscape certificate type)
    SSL server (Netscape certificate type)
    Authority key identifier
    Key usage

    The wizard now generates the certificate.

  19. Select a single sign-on password (for example, manager1).

    The system now creates a single sign-on database.

  20. Follow the instructions and point your browser to https://sunshine.init8.net:8100 to enroll as CS administrator Be sure to have JavaScriptTM technology enabled in your browser.

    The CS administrator role is used to approve certificate requests.

  21. Accept the server certificate.

    If you are not automatically directed to the enrollment page, go to https://sunshine.init8.net:8100/ca/adminEnroll.html. You are challenged with a form. Provide the following necessary information:

    User ID: admin
    Password: manager1
    Full Name: iNIT8 CS administrator
    Login Name: admin
    E-Mail: csadmin@init8.net
    Organizational Unit: iNIT8 CS
    Organization: iNIT8
    Country: DE
    Validity: 1 year
    Key length: 1024 Bit

    Click Submit.

    The Certificate Server now instructs your browser to generate a new key pair. If this is the first key pair to be generated in this browser, you are asked for a password to protect the Communicator's Certificate Database. The certificate database is a file which resides in ~/.netscape/cert.db7. In order to protect this file, the data stored in the file is encrypted (this is similar to an encrypted SSH key file).

    A new certificate is now displayed of which following is a partial example:

        Version: v3
        Serial Number: 0x4
        Signature Algorithm: SHA1withRSA - 1.2.840.113549.1.1.5
        Issuer: CN=iNIT8 Certificate Manager, OU=CERT, O=iNIT8,L=Hamburg, 
         Not Before: Monday, December 17, 2001 9:43:40 PM GMT+00:00
         Not After: Tuesday, December 17, 2002 9:43:40 PM GMT+00:00
        Subject: E=csadmin@init8.net,CN=iNIT8 CS 
        Administrator,UID=admin,OU=iNIT8 CS,O=iNIT8,C=DE
        Subject Public Key Info: 
         Algorithm: RSA - 1.2.840.113549.1.1.1
         Public Key: 
          Exponent: 65537
          Public Key Modulus: (1024 bits) :
     Identifier: Netscape Certificate Type - 2.16.840.1.113730.1.1
      Critical: no 
      Certificate Usage: 
       SSL Client 
     Identifier: Key Usage: -
      Critical: yes 
      Key Usage: 
       Digital Signature 
       Non Repudiation 
       Key Encipherment 
     Identifier: Authority Key Identifier -
      Critical: no 
      Key Identifier: 
     Algorithm: SHA1withRSA - 1.2.840.113549.1.1.5
    Base 64 encoded certificate
    -----END CERTIFICATE-----
  22. Check the certificate in the browser: Communicator—Tools—Security Info—Certificates—Yours.

    This browser holds a certificate for iNIT8 CS Administrator's iNIT8 ID. If you try to verify the certificate, you will notice that it is not trusted, because the signing certificate, iNIT8 Certificate Manager, is not trusted (this certificate resides in the Signers class). See the section , "Setting Up the Appropriate Trust Relations" for details on how to modify the trust relationship using the shell tool certutil. You now have everything you need in order to apply and approve certificates for an SSL-secured LDAP transmission.

  23. Exit the Netscape_ console in the Sun ONE Certificate Server software directory /opt/iplanet/server4.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020