Solved

Problem retrieving certificates for signed jar using CodeSource.getCertificates

Posted on 2011-02-14
1
276 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
1 Comment
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 500 total points
Comment Utility
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now