Signal-Setup-Guide icon indicating copy to clipboard operation
Signal-Setup-Guide copied to clipboard

Certificate error

Open KashifAhmed opened this issue 4 years ago • 1 comments

After resolving lot's of issue now I am stuck on certificate issue java -jar service/target/TextSecureServer-3.21.jar server service/config/config.yml INFO [2021-04-01 22:22:25,876] io.dropwizard.server.DefaultServerFactory: Registering jersey handler with root path prefix: / INFO [2021-04-01 22:22:25,885] io.dropwizard.server.DefaultServerFactory: Registering admin handler with root path prefix: / java.lang.ClassCastException: class org.bouncycastle.jce.PKCS10CertificationRequest cannot be cast to class java.security.cert.X509Certificate (org.bouncycastle.jce.PKCS10CertificationRequest is in unnamed module of loader 'app'; java.security.cert.X509Certificate is in module java.base of loader 'bootstrap') at org.whispersystems.textsecuregcm.push.RetryingApnsClient.initializeCertificate(RetryingApnsClient.java:76) at org.whispersystems.textsecuregcm.push.RetryingApnsClient.<init>(RetryingApnsClient.java:49) at org.whispersystems.textsecuregcm.push.APNSender.<init>(APNSender.java:70) at org.whispersystems.textsecuregcm.WhisperServerService.run(WhisperServerService.java:246) at org.whispersystems.textsecuregcm.WhisperServerService.run(WhisperServerService.java:151) at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:44) at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87) at io.dropwizard.cli.Cli.run(Cli.java:78) at io.dropwizard.Application.run(Application.java:94) at org.whispersystems.textsecuregcm.WhisperServerService.main(WhisperServerService.java:406)

Is anyone know how to resolve this one.

KashifAhmed avatar Apr 01 '21 22:04 KashifAhmed

My solution is that I changed code in RetryingApnsClient.java so that it can read p12 file instead of cert text:

this.apnsClient = new ApnsClientBuilder().setClientCredentials(new File(p12FilePath), p12FilePwd)
                                         .setMetricsListener(metricsListener)
                                         .setApnsServer(sandbox ? ApnsClientBuilder.DEVELOPMENT_APNS_HOST : ApnsClientBuilder.PRODUCTION_APNS_HOST)
                                         .build();

yang093 avatar Apr 02 '21 03:04 yang093