If the web service uses an HTTPS connection, then this will communicate using SSL. SSL, or Secure Socket Layer, is a technology which allows the web service client and remote web service server to communicate over a secured connection. The data is encrypted before being transmitted and decrypted when the data is received before processing. This is a two-way process, meaning that both the server AND the browser encrypt all traffic before sending out data. A certificate is required for SSL communication.
A public key certificate (know just as a certificate) is a digitally-signed statement that binds the value of a public key to the identity of the person, device, or service that holds the corresponding private key. One of the main benefits of certificates is that passwords are not needed for individual clients who need to be authenticated as a prerequisite to access. Instead, the host merely establishes trust in a certificate issuer.
Most certificates used are based on the X.509v3 certificate standard.
Certificates contain the following information:
A Certificate Authority (CA) is an organization that issues certificates to other organizations that wish to prove their identity. The CA asks the certificate requester to provide information about itself and the CA gives back a certificate in return. The returned certificate is chained to the root certificate, establishing a chain of trust. In this way someone dealing with a company identifying itself through a certificate issued by a certain CA doesn't have to trust every company, but it is sufficient to trust the root CA.
Java (J2SE) recognises the common root certificates
Verisign, Twarte etc...; these are stored in the JRE's lib/security/cacerts
truststore.
But sometimes the certificate is not recognised and the certificate must be
imported into a Java keystore.
If the web service provider is using a self-signed
certificate or one signed by an in-house CA, it must be imported and saved in
the keystore of the client Java system. A keystore is a file that
contains all the trusted certificates available for HTTPS communication between
Ebase and the remote web service server. Certificates can be imported into the
keystore using java’s keytool utility. The keytool is part of the standard Java
Development Kit (JDK) shipment and can be found in the $JDK_HOME/bin directory.
If the
certificate has not been imported, a call to the web service may throw an
exception such as: "ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target".
If the certificate has been signed by one of the recognised CAs, the certificate does not normally need to be imported.
Follow the instructions below to import a certificate. This example uses Internet Explorer 9 to obtain the certificate, but other browsers or equivalent tools can also be used.
If you already
have the Certificate .cer file then proceed to step 9.
Import the certificate into the Java key store
keytool -import -alias <alias-name> -file
<certificate-filename> -keystore <keystore-filename>
Where:
o alias-name - is a memorable name to give to the certificate. This cannot already exist in the keystore.
o certificate-filename – is the saved trust certificate to import e.g geoTrust.cer
o keystore-filename – is the keystore filename to import the certificate into. If the keystore does not exist, it will be created automatically. e.g ebaseKeystore.keystore
o Enter the password for the keystore. If the keystore does not exist, enter a new password for this keystore.
The certificate is now stored within the
keystore. The keystore can now be used by the Ebase for SSL authentication.
Ebase Designer and
Ebase Server start-up parameters
To use the keystore created above or an existing keystore containing the required certificate; the following line (Java system property) must be added to the designer and server start-up files:
-Djavax.net.ssl.trustStore=<keystore-filename-location>
Where:
o
Keystore-filename-location
– is the absolute path to the keystore created in the Importing Certificates section.
Ebase Designer start-up (used for WSDL Imports using HTTPS):
set JAVA_PROPERTIES=%JAVA_PROPERTIES%
-Dawt.useSystemAAFontSettings=true -Dsun.java2d.noddraw=true
-Djavax.net.ssl.trustStore=<keystore-filename-location>
Ebase Server start-up:
set JAVA_OPTS=-Djavax.net.ssl.trustStore=c:\Ebase\security\ebaseKeystore.keystore
-Xmx512m -Djava.net.preferIPv4Stack=true -Dderby.system.home=%~dsp0/DB
Windows Service:
If the Ebase Server is running as a windows service: