Home > Articles > Programming > Java

Like this article? We recommend

Configuration

Start by going to the WebLogic console. If you accept the default settings when you install your domain (the place where you'll run servers and deploy code), the admin port is 7001. For example, my admin server is found here:

http://localhost:7001/console

Figure 1 shows how the console looks after logging in.

Figure 1

Figure 1 WebLogic 8.1 console after login.

In the left pane, click the plus (+) next to Servers to display a list of all the servers available in the domain. For this example, we'll use the admin server, usually named myserver in a default configuration. Click your admin server to display its configuration in the right pane (see Figure 2). On the Configuration tab, click the Keystores & SSL tab (see Figure 3).

Figure 2

Figure 2 The default console view of my admin server.

Figure 3

Figure 3 The Keystores & SSL tab for my admin server.

We're going to specify a custom-made keystore for our configuration. Click the Change link in the upper-right portion of the configuration items. Figure 4 shows the resulting drop-down list of options for configuration:

  • Demo Identity and Demo Trust. These are the certificates that I mentioned earlier. The Demo Trust simply contains the root certificate for the demo certificate authority. By default, if you're using Node Manager, the demo certificates are used.
  • Custom Identity and Java Standard Trust. The custom identity is simply a keystore that you create. The Java Standard Trust refers to the trusted keystore included in most JDKs. In the Sun JDK and BEA's JRockit JVM, you can find a file called cacerts in jre/lib/security directory. The password to this keystore is changeit.
  • Custom Identity and Custom Trust. This is the same identity configuration as above, but with this option you also provide a custom trust. If your server is engaging in two-way SSL calls as a client or a server, the custom trust is how your server will determine whether it should trust the certificate that the peer presents. If you're accepting client certificates, it's a good idea to build your own trust, which limits the certificates that can be presented to ones that are issued by the certificate authorities of your choice. The cacerts file has approximately 30 root certificates. If you're only trying to establish plain old one-way SSL, you needn't worry about this option or the next.
  • Custom Identity and Command Line Trust. Same identity as previously discussed, but this time the trust will be supplied on the command line. This option can be useful if you're going to switch trusts often and don't want to continually use the console or edit the config.xml file.
Figure 4

Figure 4 Choose Custom Identity and Java Standard Trust from the list.

Figure 5

Figure 5 The first step in the SSL configuration, where you specify your identity keystore information.

For this article, we'll select Custom Identity and Java Standard Trust. Figure 5 shows the resulting options: text fields specifying the properties of the custom identity keystore and the Java Standard Trust passphrase. My keystore is located here, for example:

D:\MyData\solutions\my_keystores\verisign-example\verisign-keystore.jks

The Keystore Type entry refers to the provider of the keystore structure. If you didn't create the keystore yourself, ask the provider what the type is. In most cases, it will be JKS, which is Sun's implementation. Then enter the password for the keystore. (Don't confuse this with your private key password; we'll enter that later.)

Enter the Java Standard Trust password. Unless you or your system administrator changed it, the password will be changeit. Click Continue.

On the following screen (see Figure 6), enter the private key alias. This is the unique identifier in the keystore for your private key. If you don't know the alias, you should be able to figure it out by going to the directory where the keystore is and running the following command:

keytool -list -v -keystore keystore-name

In my environment, here's the output:

D:\MyData\solutions\my_keystores\verisign-example>keytool -list -v -keystore verisign-keystore.jks
Enter keystore password: weblogic

Keystore type: jks
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: servercert
Creation date: Mar 6, 2005
Entry type: keyEntry
Certificate chain length: 2
Certificate[1]:
Owner: CN=jsvede, OU=Support, O=BEA Systems Inc, L=Denver, ST=Colorado, C=US
Issuer: OU=For VeriSign authorized testing only. No assurances (C)VS1997, OU=http://www.verisign.com/repository/TestCPS Incorp. By Ref. Liab. LTD., O="V
eriSign, Inc"
Serial number: 46b06fa66a04d6318949659fc4d2bb50
Valid from: Thu Feb 10 17:00:00 MST 2005 until: Fri Feb 25 16:59:59 MST 2005
Certificate fingerprints:
     MD5: 2A:B5:9D:41:91:25:4C:A8:54:02:A1:F0:36:F1:3C:B4
     SHA1: 44:3B:E6:77:82:FD:C8:B8:0A:06:04:79:BC:67:7C:AC:1E:F1:D3:2C
Certificate[2]:
Owner: OU=For VeriSign authorized testing only. No assurances (C)VS1997, OU=http://www.verisign.com/repository/TestCPS Incorp. By Ref. Liab. LTD., O="Ve
riSign, Inc"
Issuer: OU=For VeriSign authorized testing only. No assurances (C)VS1997, OU=http://www.verisign.com/repository/TestCPS Incorp. By Ref. Liab. LTD., O="V
eriSign, Inc"
Serial number: 52a9f424da674c9daf4f537852abef6e
Valid from: Sat Jun 06 18:00:00 MDT 1998 until: Tue Jun 06 17:59:59 MDT 2006
Certificate fingerprints:
     MD5: 40:06:53:11:FD:B3:3E:88:0A:6F:7D:D1:4E:22:91:87
     SHA1: 93:71:C9:EE:57:09:92:5D:0A:8E:FA:02:0B:E2:F5:E6:98:6C:60:DE


*******************************************
*******************************************
Figure 6

Figure 6 Private key information. Remember that the password for the private key may differ from the one for the keystore.

Depending on the keystore, you can probably derive the value by looking for the listing where the Entry type is keyEntry, and then looking at the alias for it:

Alias name: servercert
Creation date: Mar 6, 2005
Entry type: keyEntry
Certificate chain length: 2

The alias I used is servercert. Keep in mind that one keystore can contain more than one key, so it may not be that easy. However, if you create the keystore from scratch it will be straightforward.

Something to keep in mind is that when you do a listing of the keystore using keytool, it will prompt you for the password. You don't need to know the password to see the contents of a keystore. If you don't, the keytool will provide the following warning:

D:\MyData\solutions\my_keystores\verisign-example>keytool -list -v -keystore verisign-keystore.jks
Enter keystore password:

***************** WARNING WARNING WARNING *****************
* The integrity of the information stored in your keystore *
* has NOT been verified! In order to verify its integrity, *
* you must provide your keystore password.         *
***************** WARNING WARNING WARNING *****************

This warning lets you know that keytool cannot verify the authenticity of the keystore without the password. Specify the password when prompted.

After you enter the alias and the password, you're ready to test your configuration.

Testing the Configuration

Stop your server and edit your startWeblogic.cmd or startWebLogic.sh file. We need to change the logging level of the server, enable debugging to the standard output, and set the logging level to Info. This can actually be done through the console, but there is a specific SSL debugging flag that can only be set through the script, so it's just as easy to modify the start script for the other settings as well.

Open your script and make the changes listed below in bold:

set SERVER_NAME=admin

set CLASSPATH=%WEBLOGIC_CLASSPATH%;%POINTBASE_CLASSPATH%;%JAVA_HOME%\jre\lib\rt.jar;%WL_HOME%\server\lib\webservices.jar;%CLASSPATH%

set JAVA_OPTIONS=-Dweblogic.StdoutSeverityLevel=64 -Dweblogic.StdoutDebugEnabled=true -Dssl.debug=true

@REM Call WebLogic Server

echo .
echo CLASSPATH=%CLASSPATH%
echo .
echo PATH=%PATH%
echo .
echo ***************************************************
echo * To start WebLogic Server, use a username and  *
echo * password assigned to an admin-level user. For *
echo * server administration, use the WebLogic Server *
echo * console at http:\\[hostname]:[port]\console  *
echo ***************************************************

%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -Dweblogic.Name=%SERVER_NAME% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy="%WL_HOME%\server\lib\weblogic.policy" weblogic.Server

Now restart the server. You'll know if you have added the flags correctly because the server begins producing a lot of output. To confirm that the flags have been accepted, look at the beginning of the output at startup, and you'll see this:

***************************************************
* To start WebLogic Server, use a username and  *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console at http:\\[hostname]:[port]\console  *
***************************************************
<Mar 6, 2005 12:45:41 PM MST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 1.4.2_05-b04
 from Sun Microsystems Inc.>
<Mar 6, 2005 12:45:41 PM MST> <Debug> <TLS> <000000> <Enabled muxing IO for SSL in server>
<Mar 6, 2005 12:45:41 PM MST> <Info> <Configuration Management> <BEA-150016> <This server is being started as the administration server.>

How can you tell if your keystore is loaded? Look for the following in the debugging output:

<Mar 6, 2005 1:23:02 PM MST> <Debug> <TLS> <000000> <SSLManager: getting server private key>
<Mar 6, 2005 1:23:02 PM MST> <Notice> <Security> <BEA-090170> <Loading the private key stored under the alias servercert from the jks keystore fi
le D:\MyData\solutions\my_keystores\verisign-example\verisign-keystore.jks.>
<Mar 6, 2005 1:23:02 PM MST> <Debug> <TLS> <000000> <SSLManager.getServerCertificate()>
<Mar 6, 2005 1:23:02 PM MST> <Notice> <Security> <BEA-090171> <Loading the identity certificate stored under the alias servercert from the jks ke
ystore file D:\MyData\solutions\my_keystores\verisign-example\verisign-keystore.jks.>
<Mar 6, 2005 1:23:02 PM MST> <Notice> <WebLogicServer> <BEA-000298> <Certificate expires in 14 days: [

Additionally, near the end of the output will be more information about whether the configuration changes were successful:

<Mar 6, 2005 1:23:08 PM MST> <Info> <WebLogicServer> <BEA-000300> <Certificate contents: 2 certificate(s):
 fingerprint = c597c372b1ebe10124382d5f32a40239, not before = Sat Mar 05 17:00:00 MST 2005, not after = Sun Mar 20 16:59:59 MST 2005, holder = C
=US SP=Colorado L=Denver O=BEA Systems Inc OU=Support CN=jsvede , issuer = O=VeriSign, Inc OU=For VeriSign authorized testing only. No assurances
 (C)VS1997 , key = modulus length=129, exponent length=3
 fingerprint = 40065311fdb33e880a6f7dd14e229187, not before = Sat Jun 06 18:00:00 MDT 1998, not after = Tue Jun 06 17:59:59 MDT 2006, holder = O
=VeriSign, Inc OU=For VeriSign authorized testing only. No assurances (C)VS1997 , issuer = O=VeriSign, Inc OU=For VeriSign authorized testing onl
y. No assurances (C)VS1997 , key = modulus length=65, exponent length=3
>
...
<Mar 6, 2005 1:23:08 PM MST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
<Mar 6, 2005 1:23:08 PM MST> <Notice> <WebLogicServer> <BEA-000355> <Thread "SSLListenThread.Default" listening on port 7002, ip address *.*>

The only step left is to try accessing your server over the SSL port. The easiest way to test this is to access the console over the secure port.

Configuring Without the Console

Suppose you don't like using a GUI for configuration. You can actually do all of this work in the config.xml file—the configuration file in which WebLogic 8.1 stores the configuration information that's in the console. For example, here's my <Server> stanza after I've started the server for the first time:

<Server ListenAddress="" ListenPort="7001" Name="admin"
  NativeIOEnabled="true" ServerVersion="8.1.4.0"
  StdoutSeverityLevel="64" StuckThreadMaxTime="60"
  StuckThreadTimerInterval="60">
  <SSL Enabled="true" HostnameVerificationIgnored="false"
    IdentityAndTrustLocations="KeyStores" Name="admin"/>
</Server>

Here it is again, after I've made all the changes in the console (obviously there are a lot of additions, shown here in bold):

<Server
  CustomIdentityKeyStoreFileName="D:\MyData\solutions\my_keystores\verisign-example\verisign-keystore.jks"
  CustomIdentityKeyStorePassPhraseEncrypted="{3DES}OoO7mtolODVhXfQVNGO+8Q=="
  CustomIdentityKeyStoreType="jks"
  JavaStandardTrustKeyStorePassPhraseEncrypted="{3DES}kFL3FTkIpZgW+fJrYYO58w=="
  KeyStores="CustomIdentityAndJavaStandardTrust" ListenAddress=""
  ListenPort="7001" Name="admin" NativeIOEnabled="true"
  ServerVersion="8.1.4.0" StdoutSeverityLevel="64"
  StuckThreadMaxTime="60" StuckThreadTimerInterval="60">
  <SSL Enabled="true" HostnameVerificationIgnored="false"
    IdentityAndTrustLocations="KeyStores" Name="admin"
    ServerPrivateKeyAlias="servercert" ServerPrivateKeyPassPhraseEncrypted="{3DES}OoO7mtolODVhXfQVNGO+8Q=="/>
</Server>

You can replace any of the encrypted passwords with clear text; when the server is restarted, the text will be encrypted. (Be careful not to leave the password unencrypted for very long, though.)

Troubleshooting

Like everything else in life, SSL configuration rarely goes as smoothly as I just described. Here are some common problems:

  • Incomplete certificate chain. Users often are missing the root certificate or an intermediate certificate when they build their keystore. You should be able to go from your public certificate's issuer to the subject of the intermediate certificate, and then from the intermediate certificate's issuer to the subject of the root certificate. If you can't, you're going to have problems.
  • Private key/public certificate mismatch. This problem can be tricky to diagnose, so my advice is to keep close track of private keys and certificate-signing requests, and sign certificates very carefully. If you have mismatched certificates, your public certificate will have to be reissued.
  • Migrating from an earlier version of WebLogic. In version 6.1, private keys didn't require a password; therefore, many people didn't supply one. Although WebLogic ships with a utility called wlkeytool to help encrypt the private key, there are a variety of situations in which this utility doesn't work. In general, if you run into a problem with encrypting the private key, it's easier to rebuild the private key in a keystore specifically for WebLogic.
  • Proprietary certificate authorities. If you work for a bank or financial institution, government contractor, or government, or your company is using OpenSSL, you may encounter other issues that can cause a keystore or private key to cause problems in WebLogic Server. Sometimes it's a compliance issue in which the certificate that's signed by the CA is incorrect, or the problem may be the encoding of certain characters in the certificate. If you're having problems with your keys or certificates, you may need to call for support.

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.

Overview


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.

Surveys

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.

Newsletters

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.

Security


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

Children


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

Marketing


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.

Choice/Opt-out


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.

Links


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