javaee / metro-jax-ws

https://javaee.github.io/metro-jax-ws/
Other
132 stars 68 forks source link

Replace usage of X509Certificate.getIssuerDN() with getIssuerX500Principal() #1148

Open glassfishrobot opened 10 years ago

glassfishrobot commented 10 years ago

X509Certificate.getIssuerDN() should not be used any more, X509Certificate.getIssuerX500Principal() should be used instead, see: http://docs.oracle.com/javase/7/docs/api/java/security/cert/X509Certificate.html#getIssuerDN%28%29

Some JCE provider like Bouncy Castle return a wrongly formated String there, because it is not specified.

The return value of "xCert.getIssuerDN().getName()" on a X509Certificate is not specified, but metro assumes that it is a string formated accordingly to RFC 4514 section 2.1, because http://www.ws-i.org/Profiles/BasicSecurityProfile-1.1.html says so.

When replacing this call with getIssuerX500Principal() Bouncy Castle returns the correctly formated string.

The main Problem I see is in ws-sx/wssx-impl/src/main/java/com/sun/xml/ws/security/opt/impl/keyinfo/X509TokenBuilder.java

metro returns the following part in the Soap Webservice when using a certificate from Bouncy castle:

CN=bos CA eID Communication Certs,O=bremen online services,C=DE 904391263803916562 The X509IssuerName element should be ordered the other way around. #### Affected Versions [2.2.7]
glassfishrobot commented 10 years ago

Reported by hme

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAX_WS-1148