P4 Plugin throws "Error occurred during the SSL handshake: invalid SSL session" Error

2,028 views
Skip to first unread message

Shobha Dashottar

unread,
Sep 25, 2014, 11:46:01 AM9/25/14
to jenkins...@googlegroups.com
I am setting up a  new Jenkins server. I have been using the Perforce Plugin so far but this time I have switched to the P4 Plugin as has a good integration with the Credential Plugin to connect to the perforce server. 

For most of the VMs that I am connecting to it goes ahead with P4 command execution without issue. So far one VM is giving issue and throwing exception while even trying to communicate with the perforce server.

P4: Unable to connect: com.perforce.p4java.exception.ConnectionException: Error occurred during the SSL handshake: invalid SSL session
P4: Unable to use Workspace: java.lang.NullPointerException
P4: Unable to close Perforce connection: java.lang.NullPointerException
ERROR: Unable to update workspace: java.lang.NullPointerException

After following some articles, I have added the jars from JCE for Java 7 inside the slave VMs jre/lib/security folder.
But still the error keeps popping up.

Does anyone know what is going on or is missing on that VM?

Thanks
Shobha


Dan Tran

unread,
Sep 25, 2014, 12:02:35 PM9/25/14
to jenkins...@googlegroups.com

Very likely, you patch the wrong JRE

-D

Shobha Dashottar

unread,
Sep 25, 2014, 1:15:01 PM9/25/14
to jenkins...@googlegroups.com
I have now removed all the older jre versions from the systems leaving jre only in one place. I even have the JRE  home in the PATH variable.

I have setup some Windows VMs now but those are too giving the same error. They already have the JCE jars in their installation folders.

Is there some other requirement for this to work ?

Thanks
Shobha

Dan Tran

unread,
Sep 25, 2014, 10:11:13 PM9/25/14
to jenkins...@googlegroups.com

 run a java test with your JRE?

    private boolean isUnlimitedCryptoSupported() throws NoSuchAlgorithmException {
        int bits = Cipher.getMaxAllowedKeyLength("AES");
        this.getLog().info("Current encryption strength is: " + bits);
        return bits == 2147483647;

Dan Tran

unread,
Sep 26, 2014, 12:00:58 PM9/26/14
to jenkins...@googlegroups.com

Also note, that p4jenkins uses the startup JRE to talk to perforce ( not the one configure in the job)

-D

Shobha Dashottar

unread,
Sep 29, 2014, 2:23:08 AM9/29/14
to jenkins...@googlegroups.com
I ran that test code and earlier it gave 128 . So, made a few more changes like reinstalling jdk, setting the java paths in a few more files for Jenkins to get the path during slave launch itself and then finally copying the UnlimitedJCEPolicy jar files even though they existed in the security folder.

Looks like something was messed up in my java environment as after I ran the test code it gave me the value 2147483647.  the SSL handshake error has gone away too.

Thanks Dan for your help on this. Much Appreciated.

Dan Tran

unread,
Sep 29, 2014, 12:35:33 PM9/29/14
to jenkins...@googlegroups.com
BTW, I am looking for maven users to try p4maven with maven release plugin as well.  Let me know if you need help on that area

Hassan Iqbal

unread,
Jul 19, 2016, 8:23:25 AM7/19/16
to Jenkins Users
I was also facing similar problem. Even after updating the JCE jars for java 8, SSL connection issue was coming. Reinstalling the JDK-8u92 and then updating the JCE solved the issue.

Irfan Sayed

unread,
Jul 19, 2016, 8:39:56 AM7/19/16
to jenkins...@googlegroups.com
you need to install the JCE and JRE with same version and have to be on the default path when p4 need them. as per the code of p4 plugin, these two need to be on the same version and registered.

please make sure you have these. 

this will solve the issue
Regards
Irfan


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d948f1e5-53b2-4a3c-bad9-70a0a3dfde5a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages