X509 Subject Formatting
Problem this snippet solves: TMOS v12.1.4.1 and v13 have a change where the output of X509::subject is formatted to match OpenSSL output. See https://cdn.f5.com/product/bugtracker/ID607410.html ...
Published Oct 18, 2019
Version 1.0PeteWhite
Employee
Joined May 16, 2019
PeteWhite
Employee
Joined May 16, 2019
Stan_PIRON_F5
Nov 20, 2019Employee
: The regsub try to match the largest pattern...
The first match string is:
London, City of", L=Bar, O=Foo, OU=TEST, CN="F5lab
The second is
local"
So you have to force stoping at the first "... replace the .* with [^"]*
The problem with this expression is it will also match this string:
f", L=Bar, O=Foo, OU=TEST, CN="
This expression seems to work with your example:
% set subject [regsub -all {([a-zA-Z]+ ?= ?"[^"]+),([^"]+")} $subject "\\1--COMMA--\\2"]
C=GB, ST="London--COMMA-- City of", L=Bar, O=Foo, OU=TEST, CN="F5lab--COMMA-- local"