This commit is contained in:
@@ -54,6 +54,14 @@ public class ApnsService implements Service {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(AnyValue conf) {
|
public void init(AnyValue conf) {
|
||||||
|
new Thread() {
|
||||||
|
{
|
||||||
|
setDaemon(true);
|
||||||
|
setPriority(Thread.MAX_PRIORITY);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
try {
|
try {
|
||||||
final String path = "/" + this.getClass().getPackage().getName().replace('.', '/') + "/" + apnscertpath;
|
final String path = "/" + this.getClass().getPackage().getName().replace('.', '/') + "/" + apnscertpath;
|
||||||
KeyStore ks = KeyStore.getInstance("PKCS12");
|
KeyStore ks = KeyStore.getInstance("PKCS12");
|
||||||
@@ -67,11 +75,13 @@ public class ApnsService implements Service {
|
|||||||
tmf.init((KeyStore) null);
|
tmf.init((KeyStore) null);
|
||||||
SSLContext context = SSLContext.getInstance("TLS");
|
SSLContext context = SSLContext.getInstance("TLS");
|
||||||
context.init(kf.getKeyManagers(), tmf.getTrustManagers(), null);
|
context.init(kf.getKeyManagers(), tmf.getTrustManagers(), null);
|
||||||
this.sslFactory = context.getSocketFactory();
|
ApnsService.this.sslFactory = context.getSocketFactory();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, this.getClass().getSimpleName() + " init SSLContext error", e);
|
logger.log(Level.SEVERE, this.getClass().getSimpleName() + " init SSLContext error", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}.start();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void destroy(AnyValue conf) {
|
public void destroy(AnyValue conf) {
|
||||||
|
|||||||
Reference in New Issue
Block a user