@Test // Client specifies cert and it is required public void testTLSClientCertPKCS12RequiredOpenSSL() throws Exception { testTLS(Cert.CLIENT_PKCS12, Trust.SERVER_JKS, Cert.SERVER_JKS, Trust.CLIENT_JKS).clientOpenSSL().requiresClientAuth().pass(); }
@Test // Client specifies cert and it is required public void testTLSClientCertPEMRequiredOpenSSL() throws Exception { testTLS(Cert.CLIENT_PEM, Trust.SERVER_JKS, Cert.SERVER_JKS, Trust.CLIENT_JKS).clientOpenSSL().requiresClientAuth().pass(); }
@Test // Client trusts OpenSSL with PEM public void testTLSClientTrustServerCertWithJKSOpenSSL() throws Exception { testTLS(Cert.NONE, Trust.SERVER_JKS, Cert.SERVER_JKS, Trust.NONE).clientOpenSSL().pass(); }
@Test // Test host verification with a CN NOT matching localhost public void testTLSVerifyNonMatchingHostOpenSSL() throws Exception { testTLS(Cert.NONE, Trust.SERVER_JKS, Cert.SERVER_MIM, Trust.NONE).clientVerifyHost().clientOpenSSL().fail(); }
@Test public void testSNIWithOpenSSL() throws Exception { X509Certificate cert = testTLS(Cert.NONE, Trust.SNI_JKS_HOST2, Cert.SNI_JKS, Trust.NONE) .clientOpenSSL() .serverOpenSSL() .serverSni() .requestOptions(new RequestOptions().setSsl(true).setPort(4043).setHost("host2.com")) .pass() .clientPeerCert(); assertEquals("host2.com", TestUtils.cnOf(cert)); }
@Test // Client specifies cert and it is required public void testTLSClientCertRequiredOpenSSL() throws Exception { testTLS(Cert.CLIENT_JKS, Trust.SERVER_JKS, Cert.SERVER_JKS, Trust.CLIENT_JKS).clientOpenSSL().requiresClientAuth().pass(); }
@Test // Server specifies cert that the client trusts (not trust all) public void testTLSClientTrustServerCertWithPKCS12OpenSSL() throws Exception { testTLS(Cert.NONE, Trust.SERVER_PKCS12, Cert.SERVER_JKS, Trust.NONE).clientOpenSSL().pass(); }
@Test // Test host verification with a CN matching localhost public void testTLSVerifyMatchingHostOpenSSL() throws Exception { testTLS(Cert.NONE, Trust.SERVER_JKS, Cert.SERVER_JKS, Trust.NONE).clientVerifyHost().clientOpenSSL().pass(); }
@Test // Server specifies cert that the client trusts (not trust all) public void testTLSClientTrustServerCertWithPEMOpenSSL() throws Exception { testTLS(Cert.NONE, Trust.SERVER_PEM, Cert.SERVER_JKS, Trust.NONE).clientOpenSSL().pass(); }
@Test public void testSNIWithOpenSSL() throws Exception { X509Certificate cert = testTLS(Cert.NONE, Trust.SNI_JKS_HOST2, Cert.SNI_JKS, Trust.NONE) .clientOpenSSL() .serverOpenSSL() .serverSni() .requestOptions(new RequestOptions().setSsl(true).setPort(4043).setHost("host2.com")) .pass() .clientPeerCert(); assertEquals("host2.com", TestUtils.cnOf(cert)); }
@Test // Client specifies cert and it is required public void testTLSClientCertPEMRequiredOpenSSL() throws Exception { testTLS(Cert.CLIENT_PEM, Trust.SERVER_JKS, Cert.SERVER_JKS, Trust.CLIENT_JKS).clientOpenSSL().requiresClientAuth().pass(); }
@Test // Client trusts OpenSSL with PEM public void testTLSClientTrustServerCertWithJKSOpenSSL() throws Exception { testTLS(Cert.NONE, Trust.SERVER_JKS, Cert.SERVER_JKS, Trust.NONE).clientOpenSSL().pass(); }
@Test // Test host verification with a CN NOT matching localhost public void testTLSVerifyNonMatchingHostOpenSSL() throws Exception { testTLS(Cert.NONE, Trust.SERVER_JKS, Cert.SERVER_MIM, Trust.NONE).clientVerifyHost().clientOpenSSL().fail(); }
@Test // Client specifies cert and it is required public void testTLSClientCertPKCS12RequiredOpenSSL() throws Exception { testTLS(Cert.CLIENT_PKCS12, Trust.SERVER_JKS, Cert.SERVER_JKS, Trust.CLIENT_JKS).clientOpenSSL().requiresClientAuth().pass(); }
@Test // Client specifies cert and it is required public void testTLSClientCertRequiredOpenSSL() throws Exception { testTLS(Cert.CLIENT_JKS, Trust.SERVER_JKS, Cert.SERVER_JKS, Trust.CLIENT_JKS).clientOpenSSL().requiresClientAuth().pass(); }
@Test // Server specifies cert that the client trusts (not trust all) public void testTLSClientTrustServerCertWithPKCS12OpenSSL() throws Exception { testTLS(Cert.NONE, Trust.SERVER_PKCS12, Cert.SERVER_JKS, Trust.NONE).clientOpenSSL().pass(); }
@Test // Server specifies cert that the client trusts (not trust all) public void testTLSClientTrustServerCertWithPEMOpenSSL() throws Exception { testTLS(Cert.NONE, Trust.SERVER_PEM, Cert.SERVER_JKS, Trust.NONE).clientOpenSSL().pass(); }
@Test // Test host verification with a CN matching localhost public void testTLSVerifyMatchingHostOpenSSL() throws Exception { testTLS(Cert.NONE, Trust.SERVER_JKS, Cert.SERVER_JKS, Trust.NONE).clientVerifyHost().clientOpenSSL().pass(); }