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 Java / JMS » SSL/TLS Certificate Aliases with blanks

Post new topic  Reply to topic
 SSL/TLS Certificate Aliases with blanks « View previous topic :: View next topic » 
Author Message
RogerLacroix
PostPosted: Mon Sep 26, 2022 1:06 pm    Post subject: SSL/TLS Certificate Aliases with blanks Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3258
Location: London, ON Canada

All,

A customer stumbled across a weird thing with SSL/TLS certificate aliases with blanks (spaces).

Here's what happened:
- A customer was using MQ Explorer v9.2.0.6 with connection to a remote queue manager using a Trusted Certificate Store & everything was working fine.
- The customer imported the MQ Explorer configuration into MQ Visual Edit. Note: MQ Visual Edit uses OpenJDK v8
- When they attempted to connect to the remote queue manager, the connection would fail with reason code of 2393 (MQRC_SSL_INITIALIZATION_ERROR).
- They manually verified that the imported connection details were the same in both MQ Explorer and MQ Visual Edit.
- I had no answer but I love customers that do a little research. They used a Key Tool to view the Trusted Store file and decided to change the alias names which had spaces in them to underscores. Once they did that, MQ Visual Edit could successfully connect to the remote queue manager using that Trusted Store file.

I'm completely baffled by the situation. MQ Explorer is a Java application using an IBM JRE v8. MQ Visual Edit is a Java application using OpenJDK JRE v8. So WTF!!!!! So, why is it that IBM's JRE can handle spaces in a certificate alias but OpenJDK cannot. They are both at version 8 and both are based on Oracle's Java specs.

So, can someone explain to me why there is this weird quirk?

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
markt
PostPosted: Mon Sep 26, 2022 10:03 pm    Post subject: Reply with quote

Knight

Joined: 14 May 2002
Posts: 508

I would imagine it's different behaviour from different JSSE providers that are loaded by the JVMs. Look, for example, at /opt/mqm/java/jre64/lib/security/java.security which says which security libraries are used for that JRE. The IBM-provided JRE will likely have the IBM JSSE configured as its default; a "raw" OpenJDK will not.

Why the two JSSE providers have chosen different parsing options is a different question ... and likely not defined in any specification. Like the CipherSpec variations were not standardised.
Back to top
View user's profile Send private message
tczielke
PostPosted: Tue Sep 27, 2022 9:16 am    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 941
Location: Illinois, USA

In the class documentation for java.security.KeyStore, it does have the following blurb:

Quote:
Whether aliases are case sensitive is implementation dependent. In order to avoid problems, it is recommended not to use aliases in a KeyStore that only differ in case.


That does not sound like very specific requirements, to me.

Maybe the same applies for embedded spaces in the alias name, as well?
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Sep 27, 2022 11:00 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9442
Location: US: west coast, almost. Otherwise, enroute.

tczielke wrote:
In the class documentation for java.security.KeyStore, it does have the following blurb:

Quote:
Whether aliases are case sensitive is implementation dependent. In order to avoid problems, it is recommended not to use aliases in a KeyStore that only differ in case.


That does not sound like very specific requirements, to me.

Maybe the same applies for embedded spaces in the alias name, as well?

Space (x’20’) is a special-caseless case, in this case.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Tue Sep 27, 2022 2:31 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3258
Location: London, ON Canada

Hi Mark,
markt wrote:
I would imagine it's different behaviour from different JSSE providers that are loaded by the JVMs. Look, for example, at /opt/mqm/java/jre64/lib/security/java.security which says which security libraries are used for that JRE. The IBM-provided JRE will likely have the IBM JSSE configured as its default; a "raw" OpenJDK will not.

Thanks. I looked at the java.security file & can see that security.provider.1 is set to com.ibm.jsse2.IBMJSSEProvider2 but I don't see anything about "raw".

Or do you mean that it is an internal configuration?

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Wed Sep 28, 2022 12:42 am    Post subject: Reply with quote

Grand High Poobah

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

Roger,

How does the OpenJDk handle an alias when it's delimited by quotes?

May be this is just a problem of how the parameter is being passed once the store is being scanned / loaded.

You'd probably have to load the store and enumerate it's content to see any differences in the alias names...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
RogerLacroix
PostPosted: Thu Sep 29, 2022 2:27 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3258
Location: London, ON Canada

fjb_saper wrote:
How does the OpenJDk handle an alias when it's delimited by quotes?

May be this is just a problem of how the parameter is being passed once the store is being scanned / loaded.

You'd probably have to load the store and enumerate it's content to see any differences in the alias names...

Well, I have not looked at the OpenJDK code, so I can't answer that question.

The Java code simply checks if the field has a value & if so then set it like:
Code:
System.setProperty("javax.net.ssl.trustStore", "trustedStore");
System.setProperty("javax.net.ssl.trustStorePassword", "pwd");

Loading the store and enumerating it is a little over kill. I think it is easier to ask the customer if there aliases have blanks in it then get them to remove the blanks.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » SSL/TLS Certificate Aliases with blanks
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.