@@ -59,15 +59,23 @@ public void run()
59
59
{
60
60
try
61
61
{
62
- KeyManagerFactory keyManagerFactory = KeyManagerFactory .getInstance ("PKIX" );
62
+ boolean isJdk15 = System .getProperty ("java.version" ).indexOf ("1.5." ) == 0 ;
63
+
64
+ KeyManagerFactory keyManagerFactory = isJdk15 ?
65
+ KeyManagerFactory .getInstance ("PKIX" , ProviderUtils .PROVIDER_NAME_BCJSSE ) :
66
+ KeyManagerFactory .getInstance ("PKIX" );
63
67
64
68
keyManagerFactory .init (keyStore , password );
65
69
66
- TrustManagerFactory trustManagerFactory = TrustManagerFactory .getInstance ("PKIX" );
70
+ TrustManagerFactory trustManagerFactory = isJdk15 ?
71
+ TrustManagerFactory .getInstance ("PKIX" , ProviderUtils .PROVIDER_NAME_BCJSSE ) :
72
+ TrustManagerFactory .getInstance ("PKIX" );
67
73
68
74
trustManagerFactory .init (serverStore );
69
75
70
- SSLContext context = SSLContext .getInstance ("TLS" );
76
+ SSLContext context = isJdk15 ?
77
+ SSLContext .getInstance ("TLS" , ProviderUtils .PROVIDER_NAME_BCJSSE ) :
78
+ SSLContext .getInstance ("TLS" );
71
79
72
80
context .init (keyManagerFactory .getKeyManagers (), trustManagerFactory .getTrustManagers (), null );
73
81
@@ -92,9 +100,10 @@ public void run()
92
100
93
101
ss .close ();
94
102
}
95
- catch (Exception e )
103
+ catch (Throwable e )
96
104
{
97
- e .printStackTrace ();
105
+ Thread .currentThread ().interrupt ();
106
+ latch .countDown ();
98
107
}
99
108
}
100
109
};
@@ -109,7 +118,7 @@ public void run()
109
118
}
110
119
catch (InterruptedException e )
111
120
{
112
-
121
+ e . printStackTrace ();
113
122
}
114
123
}
115
124
}
0 commit comments