Commit c89d2a94 authored by Mickaël Guessant's avatar Mickaël Guessant

Remove Sun (Oracle) JDK dependency in unit test

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@2471 3d1905a2-6b24-0410-a738-b14d5a86fcbd
parent 17903586
......@@ -133,7 +133,7 @@ public class ClientCertificateTest extends TestCase {
}
}
public void testClientSocket() throws NoSuchAlgorithmException, KeyStoreException, IOException, CertificateException, KeyManagementException, UnrecoverableKeyException {
public void testClientSocket() throws NoSuchAlgorithmException, KeyStoreException, IOException, CertificateException, KeyManagementException, UnrecoverableKeyException, InstantiationException, ClassNotFoundException, IllegalAccessException {
......@@ -151,7 +151,7 @@ public class ClientCertificateTest extends TestCase {
}
Provider sunMSCAPI = new sun.security.mscapi.SunMSCAPI();
Provider sunMSCAPI = (Provider) Class.forName("sun.security.mscapi.SunMSCAPI").newInstance();
//Security.insertProviderAt(sunMSCAPI, 1);
KeyStore keyStore = KeyStore.getInstance("Windows-MY",sunMSCAPI);
keyStore.load(null, null);
......@@ -182,7 +182,7 @@ public class ClientCertificateTest extends TestCase {
}
private SSLContext createSSLContext() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, KeyManagementException, KeyStoreException, IOException, CertificateException, UnrecoverableKeyException {
private SSLContext createSSLContext() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, KeyManagementException, KeyStoreException, IOException, CertificateException, UnrecoverableKeyException, InstantiationException, ClassNotFoundException, IllegalAccessException {
// PKCS11 client certificate settings
String pkcs11Library = Settings.getProperty("davmail.ssl.pkcs11Library");
......@@ -226,7 +226,8 @@ public class ClientCertificateTest extends TestCase {
}
System.setProperty("javax.net.debug", "ssl,handshake");
//try {
Provider sunMSCAPI = new sun.security.mscapi.SunMSCAPI();
//Provider sunMSCAPI = new sun.security.mscapi.SunMSCAPI();
Provider sunMSCAPI = (Provider) Class.forName("sun.security.mscapi.SunMSCAPI").newInstance();
//Security.insertProviderAt(sunMSCAPI, 1);
KeyStore keyStore = KeyStore.getInstance("Windows-MY", sunMSCAPI);
......@@ -282,7 +283,7 @@ public class ClientCertificateTest extends TestCase {
}
}
public void testClientSocketFactory() throws NoSuchAlgorithmException, KeyStoreException, IOException, CertificateException, KeyManagementException, UnrecoverableKeyException, InvalidAlgorithmParameterException {
public void testClientSocketFactory() throws NoSuchAlgorithmException, KeyStoreException, IOException, CertificateException, KeyManagementException, UnrecoverableKeyException, InvalidAlgorithmParameterException, InstantiationException, ClassNotFoundException, IllegalAccessException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment