### Establish P4Java SSL Connection and Trust Source: https://github.com/perforce/p4java/blob/master/RELEASE.md Use this snippet to create an SSL connection to a secure P4 server and establish trust by accepting the SSL certificate's public key fingerprint. Ensure you have the unlimited strength JCE package installed for your JDK. ```java String serverUri = "p4javassl://perforce:1667"; Properties props = null; IOptionsServer server = ServerFactory.getOptionsServer(serverUri, props); // assume a new first time connection // you should also handle a key change situation... server.addTrust(new TrustOptions().setAutoAccept(true)); // if all goes well... IServerInfo serverInfo = server.getServerInfo(); ``` -------------------------------- ### Create P4Java SSL Connection Source: https://github.com/perforce/p4java/blob/master/README.md Demonstrates how to establish a secure SSL connection to a Perforce server using P4Java. This includes setting the server URI, adding trust options for new or changed keys, and retrieving server information. ```java // Create a P4Java SSL connection to a secure Perforce server try { String serverUri = "p4javassl://perforce:1667"; Properties props = null; IOptionsServer server = ServerFactory.getOptionsServer(serverUri, props); // assume a new first time connection // you should also handle a key change situation... server.addTrust(new TrustOptions().setAutoAccept(true)); // if all goes well... IServerInfo serverInfo = server.getServerInfo(); } catch (P4JavaException e) { // process P4Java exception } catch (Exception e) { // process other exception } ``` -------------------------------- ### Gradle Dependency for P4Java Source: https://github.com/perforce/p4java/blob/master/README.md Add the P4Java dependency to your Gradle project. Ensure you are using version 2019.1 or later. ```gradle compile group: 'com.perforce', name: 'p4java', version: '2019.1.1939255' ``` -------------------------------- ### Maven Dependency for P4Java Source: https://github.com/perforce/p4java/blob/master/README.md Add the P4Java dependency to your Maven project. Ensure you are using version 2019.1 or later. ```xml com.perforce p4java 2019.1.1939255 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.