ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Security » java.security.NoSuchAlgorithmException: Algorithm SunX509 no

Post new topic  Reply to topic
 java.security.NoSuchAlgorithmException: Algorithm SunX509 no « View previous topic :: View next topic » 
Author Message
vikas.bhu
PostPosted: Mon Sep 27, 2010 2:44 am    Post subject: java.security.NoSuchAlgorithmException: Algorithm SunX509 no Reply with quote

Disciple

Joined: 17 May 2009
Posts: 159

java.security.NoSuchAlgorithmException: Algorithm SunX509 not available'.

Hi,

We had a custom java node in the MB code, which has been successfully deployed on two different environments.

The code runs fine on one environment, but fails on the other with the following error.
The jar files of the external custom node deployed on the jplugin folder of the env is same in both the cases.

Following is the code fragment where the flow fails:
public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
try
{
TrustManager[] trustAllCerts = getTrustManager();
KeyManagerFactory kmf;
KeyStore ks;
char[] passphrase = this.getKeyStorePassWd().toCharArray();
kmf = KeyManagerFactory.getInstance("SunX509");
ks = KeyStore.getInstance("jks");
ks.load(new FileInputStream(this.getCaStoreFileName()), passphrase);
kmf.init(ks, passphrase);
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(kmf.getKeyManagers(), trustAllCerts, null);
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
SocketFactory socketFactory = HttpsURLConnection.getDefaultSSLSocketFactory();
return socketFactory.createSocket(host, port);
}
catch (Exception ex) {
throw new UnknownHostException("Problems to connect/createSocket1 " + host + ", " + ex.toString());
}
}
/**



Please explain if there is some configuration issues or missing jar files in the runtime which throws this exception.
Back to top
View user's profile Send private message Send e-mail
napier
PostPosted: Mon Sep 27, 2010 6:47 am    Post subject: Reply with quote

Apprentice

Joined: 09 Oct 2007
Posts: 48
Location: USA

Is this exception on HP-UX?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Sep 27, 2010 7:37 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

X509 is not an Algorithm! It is a format! get with the SSL program!
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
vikas.bhu
PostPosted: Mon Sep 27, 2010 9:52 pm    Post subject: Reply with quote

Disciple

Joined: 17 May 2009
Posts: 159

it is comming on windows.

even the java_home is pointing correctly.
and the3 jar file in ext folder are placed properly.

we have removed the jar files with production one,but still not working.
Back to top
View user's profile Send private message Send e-mail
vikas.bhu
PostPosted: Tue Sep 28, 2010 2:19 am    Post subject: Reply with quote

Disciple

Joined: 17 May 2009
Posts: 159

any clue please...
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Tue Sep 28, 2010 6:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

vikas.bhu wrote:
any clue please...
kmf = KeyManagerFactory.getInstance("SunX509");

This is your problem. the getInstance method requires an algorithm and what you supplied is a format...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
napier
PostPosted: Tue Sep 28, 2010 9:48 am    Post subject: Reply with quote

Apprentice

Joined: 09 Oct 2007
Posts: 48
Location: USA

We have similar exception on HP-UX. We modified the list of security provider preference order in java.security file to resolve the issue.
Back to top
View user's profile Send private message
vikas.bhu
PostPosted: Wed Sep 29, 2010 12:30 am    Post subject: Reply with quote

Disciple

Joined: 17 May 2009
Posts: 159

what exactly you changed in that file?
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Sep 29, 2010 11:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

try
Code:
kmf = KeyManagerFactory.getInstance("TLS");

_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
napier
PostPosted: Wed Sep 29, 2010 11:20 am    Post subject: Reply with quote

Apprentice

Joined: 09 Oct 2007
Posts: 48
Location: USA

We changed sun.security.provider.Sun preference from 2 to 4.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Security » java.security.NoSuchAlgorithmException: Algorithm SunX509 no
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.