File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
driver/src/main/java/org/neo4j/driver Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -838,11 +838,16 @@ public TrustStrategy withoutHostnameVerification()
838
838
* The certificate(s) in the file(s) must be encoded using PEM encoding, meaning the certificates in the file(s) should be encoded using Base64, and
839
839
* each certificate is bounded at the beginning by "-----BEGIN CERTIFICATE-----", and bounded at the end by "-----END CERTIFICATE-----".
840
840
*
841
- * @param certFiles the trusted certificate files
841
+ * @param certFiles the trusted certificate files, it must not be {@code null} or empty
842
842
* @return an authentication config
843
843
*/
844
844
public static TrustStrategy trustCustomCertificateSignedBy ( File ... certFiles )
845
845
{
846
+ Objects .requireNonNull ( certFiles , "certFiles can't be null" );
847
+ if ( certFiles .length == 0 )
848
+ {
849
+ throw new IllegalArgumentException ( "certFiles can't be empty" );
850
+ }
846
851
return new TrustStrategy ( Strategy .TRUST_CUSTOM_CA_SIGNED_CERTIFICATES , Arrays .asList ( certFiles ) );
847
852
}
848
853
You can’t perform that action at this time.
0 commit comments