Solved

Problem retrieving certificates for signed jar using CodeSource.getCertificates

Posted on 2011-02-14
1
297 Views
Last Modified: 2012-05-11
I have a signed server-side jar file that is doing some certificate checking. At runtime I attempt to retrieve the certificates with the following code:

ProtectionDomain pd = MyApplication.class.getProtectionDomain();
Certificate[] cert = pd.getCodeSource().getCertificates();

This works fine when my jar is used in a standalone command line Java application. However, when I use this jar in a web application that's deployed in Weblogic server (Linux, 64-bit Sun JVM), the getCertificates() call always returns null.  Can anyone help me and explain why this occurs, and any ideas on how to get getCertificates() to work under WebLogic (v10.3.3)?
 
0
Comment
Question by:bala_pbiddle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 500 total points
ID: 34896250
Could it be possible that you stored your certificates in the JVM default keystore? If this is the case, I think Weblogic usses it's own keystore. You have to provide them differently:
http://www.instantssl.com/ssl-certificate-support/cert_installation/ssl-certificate-weblogic.html
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert websphere application server default chained Certificates from 1024 to 2048 keysize or higher size and also you can change signatureAlgorithm . Please make sure Websphere Application Server fixpack 7.0.0.23 or Above. The following steps a…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question