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 @@ -924,11 +924,16 @@ public TrustStrategy withoutHostnameVerification()
924924 * 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
925925 * each certificate is bounded at the beginning by "-----BEGIN CERTIFICATE-----", and bounded at the end by "-----END CERTIFICATE-----".
926926 *
927- * @param certFiles the trusted certificate files
927+ * @param certFiles the trusted certificate files, it must not be {@code null} or empty
928928 * @return an authentication config
929929 */
930930 public static TrustStrategy trustCustomCertificateSignedBy ( File ... certFiles )
931931 {
932+ Objects .requireNonNull ( certFiles , "certFiles can't be null" );
933+ if ( certFiles .length == 0 )
934+ {
935+ throw new IllegalArgumentException ( "certFiles can't be empty" );
936+ }
932937 return new TrustStrategy ( Strategy .TRUST_CUSTOM_CA_SIGNED_CERTIFICATES , Arrays .asList ( certFiles ) );
933938 }
934939
You can’t perform that action at this time.
0 commit comments