Commit 4cae2514 authored by Guus der Kinderen's avatar Guus der Kinderen Committed by akrherz

OF-1494: Fix the xmppAddr SAN othername entry in generated certs.

parent 7dc07352
...@@ -488,10 +488,15 @@ public class CertificateManager { ...@@ -488,10 +488,15 @@ public class CertificateManager {
// add subjectAlternativeName extension // add subjectAlternativeName extension
boolean critical = subjectDN.getRDNs().length == 0; boolean critical = subjectDN.getRDNs().length == 0;
ASN1Sequence othernameSequence = new DERSequence(new ASN1Encodable[]{ ASN1Sequence othernameSequence = new DERSequence(
new ASN1ObjectIdentifier("1.3.6.1.5.5.7.8.5"), new DERUTF8String( domain )}); new ASN1Encodable[] {
GeneralName othernameGN = new GeneralName(GeneralName.otherName, othernameSequence); new ASN1ObjectIdentifier("1.3.6.1.5.5.7.8.5"),
GeneralNames subjectAltNames = new GeneralNames(new GeneralName[]{othernameGN}); new DERTaggedObject( true, GeneralName.otherName, new DERUTF8String( domain ) )
}
);
DERTaggedObject othernameGN = new DERTaggedObject(false, GeneralName.otherName, othernameSequence);
GeneralNames subjectAltNames = GeneralNames.getInstance( new DERSequence( othernameGN ) );
certBuilder.addExtension(Extension.subjectAlternativeName, critical, subjectAltNames); certBuilder.addExtension(Extension.subjectAlternativeName, critical, subjectAltNames);
// add keyIdentifiers extensions // add keyIdentifiers extensions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment