pki-bot / pki-issues-final

0 stars 0 forks source link

SubjectNameDefault: improve error handling when substitutions fail #2285

Open pki-bot opened 4 years ago

pki-bot commented 4 years ago

This issue was migrated from Pagure Issue #2736. Originally filed by ftweedal (@frasertweedale) on 2017-06-12 00:32:01:


When there are failed substitutions (usually due to misconfiguration of profile), there is a somewhat cryptic StringIndexOutOfBoundsException:

[10/Jun/2017:12:02:16][ajp-bio-127.0.0.1-8009-exec-1]: BasicProfile: populate() policy setid =serverCertSet          
[10/Jun/2017:12:02:16][ajp-bio-127.0.0.1-8009-exec-1]: SubjectNameDefault: populate start                            
java.lang.StringIndexOutOfBoundsException: String index out of range: -1                                             
at java.lang.String.substring(String.java:1967)                                                                      
at com.netscape.certsrv.pattern.Pattern.substitute2(Pattern.java:132)                                                
at com.netscape.cms.profile.def.EnrollDefault.mapPattern(EnrollDefault.java:804)                                     
at com.netscape.cms.profile.def.SubjectNameDefault.populate(SubjectNameDefault.java:160)                             
at com.netscape.cms.profile.def.EnrollDefault.populate(EnrollDefault.java:224)                                       
at com.netscape.cms.profile.common.BasicProfile.populate(BasicProfile.java:1101)                                     
at com.netscape.cms.profile.common.EnrollProfile.populate(EnrollProfile.java:1330)                                   
at com.netscape.cms.servlet.cert.CertProcessor.populateRequests(CertProcessor.java:362) 

We should catch exceptions related to failed substitutions in the SubjectNameDefault (and other profile components that use this substitution machinery) and report a better, more useful error message to the client.

pki-bot commented 4 years ago

Comment from mharmsen (@mharmsen) at 2017-06-12 12:31:28

Metadata Update from @mharmsen:

pki-bot commented 4 years ago

Comment from mharmsen (@mharmsen) at 2017-06-28 19:28:23

Metadata Update from @mharmsen:

pki-bot commented 4 years ago

Comment from mharmsen (@mharmsen) at 2017-09-01 11:30:18

Metadata Update from @mharmsen:

pki-bot commented 4 years ago

Comment from mharmsen (@mharmsen) at 2018-04-17 22:34:30

Per 10.5.x/10.6 Triage: 10.5

pki-bot commented 4 years ago

Comment from mharmsen (@mharmsen) at 2018-04-17 22:34:30

Metadata Update from @mharmsen: