private String getCerticateSubject ( AtomicServiceReference < Object > serviceRef , Properties sslProperties ) { String certificateDN = null ; try { certificateDN = sslHelper . getClientKeyCertSubject ( serviceRef , sslProperties ) ; } catch ( KeyStoreException ke ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . error ( tc , "CWKKD0020.ssl.get.certificate.user" , MONGO , id , ke ) ; } throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0020.ssl.get.certificate.user" , MONGO , id , ke ) ) ; } catch ( CertificateException ce ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . error ( tc , "CWKKD0020.ssl.get.certificate.user" , MONGO , id , ce ) ; } throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0020.ssl.get.certificate.user" , MONGO , id , ce ) ) ; } // handle null .... cannot find the client key if ( certificateDN == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . error ( tc , "CWKKD0026.ssl.certificate.exception" , MONGO , id ) ; } throw new RuntimeException ( Tr . formatMessage ( tc , "CWKKD0026.ssl.certificate.exception" , MONGO , id ) ) ; } return certificateDN ; }
Call security code to read the subject name from the key in the keystore