public static void trustStore(String pathToJks, String password) {
        Validate.notEmpty(password, "Password cannot be empty");
        applyTrustStore(pathToJks, password);
    }
public static void trustStore(String pathToJks, String password) {
        Validate.notEmpty(password, "Password cannot be empty");
        applyTrustStore(pathToJks, password);
    }
public static void trustStore ( String pathToJks , String password ) { Validate . notEmpty ( password , "Password cannot be empty" ) ; applyTrustStore ( pathToJks , password ) ; }
The following documentation is taken from <a href="HTTP Builder">https://github.com/jgritman/httpbuilder/wiki/SSL</a>:
<p>
<h1>SSL Configuration</h1>
<p/>
SSL should, for the most part, "just work." There are a few situations where it is not completely intuitive. You can follow the example below, or see HttpClient's SSLSocketFactory documentation for more information.
<p/>
<h1>SSLPeerUnverifiedException</h1>
<p/>
If you can't connect to an SSL website, it is likely because the certificate chain is not trusted. This is an Apache HttpClient issue, but explained here for convenience. To correct the untrusted certificate, you need to import a certificate into an SSL truststore.
<p/>
First, export a certificate from the website using your browser. For example, if you go to https://dev.java.net in Firefox, you will probably get a warning in your browser. Choose "Add Exception," "Get Certificate," "View," "Details tab." Choose a certificate in the chain and export it as a PEM file. You can view the details of the exported certificate like so:
<pre>
$ keytool -printcert -file EquifaxSecureGlobaleBusinessCA-1.crt
Owner: CN=Equifax Secure Global eBusiness CA-1, O=Equifax Secure Inc., C=US
Issuer: CN=Equifax Secure Global eBusiness CA-1, O=Equifax Secure Inc., C=US
Serial number: 1
Valid from: Mon Jun 21 00:00:00 EDT 1999 until: Sun Jun 21 00:00:00 EDT 2020
Certificate fingerprints:
MD5:  8F:5D:77:06:27:C4:98:3C:5B:93:78:E7:D7:7D:9B:CC
SHA1: 7E:78:4A:10:1C:82:65:CC:2D:E1:F1:6D:47:B4:40:CA:D9:0A:19:45
Signature algorithm name: MD5withRSA
Version: 3
....
</pre>
Now, import that into a Java keystore file:
<pre>
$ keytool -importcert -alias "equifax-ca" -file EquifaxSecureGlobaleBusinessCA-1.crt -keystore truststore_javanet.jks -storepass test1234
Owner: CN=Equifax Secure Global eBusiness CA-1, O=Equifax Secure Inc., C=US
Issuer: CN=Equifax Secure Global eBusiness CA-1, O=Equifax Secure Inc., C=US
Serial number: 1
Valid from: Mon Jun 21 00:00:00 EDT 1999 until: Sun Jun 21 00:00:00 EDT 2020
Certificate fingerprints:
MD5:  8F:5D:77:06:27:C4:98:3C:5B:93:78:E7:D7:7D:9B:CC
SHA1: 7E:78:4A:10:1C:82:65:CC:2D:E1:F1:6D:47:B4:40:CA:D9:0A:19:45
Signature algorithm name: MD5withRSA
Version: 3
...
Trust this certificate? [no]:  yes
Certificate was added to keystore
</pre>
Now you want to use this truststore in your client:
<pre>
RestAssured.trustSture("/truststore_javanet.jks", "test1234");
</pre>
or
<pre>
given().trustStore("/truststore_javanet.jks", "test1234"). ..
</pre>
</p>
<p>
Note that this is just a shortcut for:
</p>
<pre>
RestAssured.config = RestAssured.config().sslConfig(sslConfig().trustStore(pathToJks, password));
</pre>

@param pathToJks The path to the JKS. REST Assured will first look in the classpath and if not found it will look for the JKS in the local file-system
@param password  The store pass
The following documentation is taken from <a href = HTTP Builder > https : // github . com / jgritman / httpbuilder / wiki / SSL< / a > : <p > <h1 > SSL Configuration< / h1 > <p / > SSL should for the most part just work . There are a few situations where it is not completely intuitive . You can follow the example below or see HttpClient s SSLSocketFactory documentation for more information . <p / > <h1 > SSLPeerUnverifiedException< / h1 > <p / > If you can t connect to an SSL website it is likely because the certificate chain is not trusted . This is an Apache HttpClient issue but explained here for convenience . To correct the untrusted certificate you need to import a certificate into an SSL truststore . <p / > First export a certificate from the website using your browser . For example if you go to https : // dev . java . net in Firefox you will probably get a warning in your browser . Choose Add Exception Get Certificate View Details tab . Choose a certificate in the chain and export it as a PEM file . You can view the details of the exported certificate like so : <pre > $ keytool - printcert - file EquifaxSecureGlobaleBusinessCA - 1 . crt Owner : CN = Equifax Secure Global eBusiness CA - 1 O = Equifax Secure Inc . C = US Issuer : CN = Equifax Secure Global eBusiness CA - 1 O = Equifax Secure Inc . C = US Serial number : 1 Valid from : Mon Jun 21 00 : 00 : 00 EDT 1999 until : Sun Jun 21 00 : 00 : 00 EDT 2020 Certificate fingerprints : MD5 : 8F : 5D : 77 : 06 : 27 : C4 : 98 : 3C : 5B : 93 : 78 : E7 : D7 : 7D : 9B : CC SHA1 : 7E : 78 : 4A : 10 : 1C : 82 : 65 : CC : 2D : E1 : F1 : 6D : 47 : B4 : 40 : CA : D9 : 0A : 19 : 45 Signature algorithm name : MD5withRSA Version : 3 .... < / pre > Now import that into a Java keystore file : <pre > $ keytool - importcert - alias equifax - ca - file EquifaxSecureGlobaleBusinessCA - 1 . crt - keystore truststore_javanet . jks - storepass test1234 Owner : CN = Equifax Secure Global eBusiness CA - 1 O = Equifax Secure Inc . C = US Issuer : CN = Equifax Secure Global eBusiness CA - 1 O = Equifax Secure Inc . C = US Serial number : 1 Valid from : Mon Jun 21 00 : 00 : 00 EDT 1999 until : Sun Jun 21 00 : 00 : 00 EDT 2020 Certificate fingerprints : MD5 : 8F : 5D : 77 : 06 : 27 : C4 : 98 : 3C : 5B : 93 : 78 : E7 : D7 : 7D : 9B : CC SHA1 : 7E : 78 : 4A : 10 : 1C : 82 : 65 : CC : 2D : E1 : F1 : 6D : 47 : B4 : 40 : CA : D9 : 0A : 19 : 45 Signature algorithm name : MD5withRSA Version : 3 ... Trust this certificate? [ no ] : yes Certificate was added to keystore < / pre > Now you want to use this truststore in your client : <pre > RestAssured . trustSture ( / truststore_javanet . jks test1234 ) ; < / pre > or <pre > given () . trustStore ( / truststore_javanet . jks test1234 ) . .. < / pre > < / p > <p > Note that this is just a shortcut for : < / p > <pre > RestAssured . config = RestAssured . config () . sslConfig ( sslConfig () . trustStore ( pathToJks password )) ; < / pre >