@@ -114,7 +114,13 @@ private static Stream<Arguments> options() {
114114 Arguments .of ("cert-authority" , "" , false , false ), // CA, no principal: fail
115115 Arguments .of ("cert-authority" , "other" , false , false ), // CA, wrong principal: fail
116116 Arguments .of ("cert-authority,principals=\" other\" " , "user" , false , false ), // CA, principal overridden
117- Arguments .of ("cert-authority,principals=\" other\" " , "other" , false , true ) // CA, principal overridden
117+ Arguments .of ("cert-authority,principals=\" other\" " , "other" , false , true ), // CA, principal overridden
118+ Arguments .of ("cert-authority,principals=\" other,user\" " , "user" , false , true ), //
119+ // One principal "root,user" in the certificate
120+ Arguments .of ("cert-authority,principals=\" other,user\" " , "root,user" , false , false ), //
121+ // Two principals "root" and "user" in the certificate
122+ Arguments .of ("cert-authority,principals=\" other,user\" " , "root;user" , false , true ), //
123+ Arguments .of ("cert-authority,principals=\" user,other\" " , "root;user" , false , true ) //
118124 );
119125 }
120126
@@ -151,7 +157,7 @@ private void initCert(String caMarker, String... principals) throws Exception {
151157 @ MethodSource ("options" )
152158 void testCertificate (String marker , String principals , boolean allowEmpty , boolean expectSuccess ) throws Exception {
153159 CoreModuleProperties .ALLOW_EMPTY_CERTIFICATE_PRINCIPALS .set (sshd , allowEmpty );
154- String [] certPrincipals = GenericUtils .isEmpty (principals ) ? new String [0 ] : principals .split (", " );
160+ String [] certPrincipals = GenericUtils .isEmpty (principals ) ? new String [0 ] : principals .split ("; " );
155161 initCert (marker , certPrincipals );
156162 try (ClientSession s = client .connect ("user" , TEST_LOCALHOST , port ).verify (CONNECT_TIMEOUT )
157163 .getSession ()) {
0 commit comments