Jnon
Mar 08, 2018Nimbostratus
Better option for multiple delimiters
I'm thinking there has to be a smarter way to accomplish what I'm doing here. I need to break out each value in the SSL Subject_dn, maybe a regex or ?? this is getting me what I need, but pretty sure there is a better way to accomplish this... any ideas appreciated.
if {[SSL::cert count ] > 0}{ set subject_dn [X509::subject [SSL::cert 0]] log local0. "this is the SSL Subject $subject_dn" set cn [getfield $subject_dn "," 1 ] set ou [getfield $subject_dn "," 2 ] set o [getfield $subject_dn "," 3 ] log local0. "CN=$cn, OU=$ou, O=$o" set cn2 [ getfield $cn "=" 2 ] set ou2 [ getfield $ou "=" 2 ] set o2 [ getfield $o "=" 2 ] log local0. "$cn2 $ou2 $o2"