From 465e71124273009ba3f70e024891683246cb6fd0 Mon Sep 17 00:00:00 2001 From: inoshperera Date: Tue, 16 Jan 2018 15:55:23 +0530 Subject: [PATCH] https://github.com/wso2/product-iots/issues/1601 --- .../certificate/mgt/core/impl/CertificateGenerator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java index d07c109dfa..71ce11b6b1 100755 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/main/java/org/wso2/carbon/certificate/mgt/core/impl/CertificateGenerator.java @@ -427,7 +427,10 @@ public class CertificateGenerator { Date validityBeginDate = commonUtil.getValidityStartDate(); Date validityEndDate = commonUtil.getValidityEndDate(); - X500Name certSubject = new X500Name(CertificateManagementConstants.DEFAULT_PRINCIPAL); + X500Name certSubject = request.getSubject(); + if (certSubject == null) { //This is highly unlikely as the csr must have a subject name. + certSubject = new X500Name(CertificateManagementConstants.DEFAULT_PRINCIPAL); + } Attribute attributes[] = request.getAttributes(); RDN[] certUniqueIdRDN;