Perforce Public Knowledge Base - Using P4Java and P4Eclipse with SSL enabled Perforce Servers
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Reset Search



Using P4Java and P4Eclipse with SSL enabled Perforce Servers

« Go Back


Connection to an SSL enabled Perforce server fails with:
Error occurred during the SSL handshake: invalid SSL session

P4Java Release 2012.1 and later includes support for connecting to an SSL enabled Perforce Server.

For connection details, see the P4Java API User's guide section on "SSL Connection Support".

From that section:

The Perforce Server at release 2012.1 or higher supports 256-bit SSL connections.  Due to current US export control restrictions for some countries, the standard JDK package only comes with 128 bit encryption level cyphers. In order to use P4Java to connect to an SSL-enabled Perforce server, those living in eligible countries may download the unlimited strength JCE (Java Cryptography Extension) package and replace the current default cryptography jar files with the unlimited strength files.

The JCE package's README.txt file gives install instructions. 

In summary, replace the local_policy.jar and the US_export_policy.jar files found in the security directory


with the identically named files within the the download specific to your version of Java.  

This must be done on every machine running your P4Java client.  Running JVMs must be restarted.  Nothing needs to be done on the Perforce Server machine.

Oracle (Sun) JVMs:

Java 6:

Java 7:

Java 8:


The JCE packages can be obtained by:

  • Go to
  • Choose your Java Version
  • Navigate to "IBM SDK Policy files"
  • Go to the link provided at "Unlimited jurisdiction policy files can be obtained from the web site."
  • Log in with your IBM ID
  • Download "FOR OLDER VERSIONS", because although the JRE is Java 7, it's OLDER than Java 7 SR 4

Determining JAVA_HOME for Eclipse

  1. Within Eclipse, click menu Help -> About Eclipse
  2. Click the Installation Details button.
  3. Select the Configuration tab
  4. Find the java.home property

    In the example below, the files to replace would be located in the "C:\Program Files\Java\jre7\lib\security" directory
    java.ext.dirs=C:\Program Files\Java\jre7\lib\ext;C:\Windows\Sun\Java\lib\ext
    java.home=C:\Program Files\Java\jre7\temp\tmp\


Related Links



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255