jayashree31 / javapns

Automatically exported from code.google.com/p/javapns
0 stars 0 forks source link

When running under Java security protection, access denied is issued #214

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a servlet that uses JavaPNS to send push messages
2. Deploy the servlet on a Tomcat server
3. Turn on security on that Tomcat server
4. Try to send a push message

What is the expected output? What do you see instead?
The push message should be sent.
Instead the error message access denied (java.security.SecurityPermission 
putProviderProperty.BC) is shown

What version of the product are you using? On what operating system?
Version 2.2 on Linux

Please provide any additional information below.
The code works just fine if BouncyCastle and Security.getProperty is removed 
from class javapns.communication.ConnectionToAppleServer.
First of all:
    private static final String ALGORITHM = ((Security.getProperty("ssl.KeyManagerFactory.algorithm") == null) ? "sunx509" : Security.getProperty("ssl.KeyManagerFactory.algorithm"));
need to be replaced by:
    private static final String ALGORITHM = "sunx509";

Secondly the code:
    static {
        Security.addProvider(new BouncyCastleProvider());
    }
should be removed as it seems that BouncyCastle is not used anymore.

Original issue reported on code.google.com by O...@Montan.biz on 18 Mar 2014 at 10:01

GoogleCodeExporter commented 8 years ago
Fixed in r387 and r388, BouncyCastle was removed.

Thank you!

Original comment by sype...@gmail.com on 30 Sep 2014 at 3:15