First create a key pair using keytool .
keytool -genkey -alias somekeyname
Then use jarsigner to sign it with the key you just created.
jarsigner /path/to/jar somekeyname
Please note: you need to use the same alias ( somekeyname here) as the one with which you create the key.
Now, since the certificate is self-signed, the user of your applet will be asked to approve the certificate. Once they do, your tcp connections should work.
Since I assume that you use the applet only within the organization, self-signed certificates should be in order. Otherwise, you will have to pay for the certificate. In this case, your users will not need to accept certificates after the first time (if they choose Always Allow).
source share