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()
924
924
* 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
925
925
* each certificate is bounded at the beginning by "-----BEGIN CERTIFICATE-----", and bounded at the end by "-----END CERTIFICATE-----".
926
926
*
927
- * @param certFiles the trusted certificate files
927
+ * @param certFiles the trusted certificate files, it must not be {@code null} or empty
928
928
* @return an authentication config
929
929
*/
930
930
public static TrustStrategy trustCustomCertificateSignedBy ( File ... certFiles )
931
931
{
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
+ }
932
937
return new TrustStrategy ( Strategy .TRUST_CUSTOM_CA_SIGNED_CERTIFICATES , Arrays .asList ( certFiles ) );
933
938
}
934
939
You can’t perform that action at this time.
0 commit comments