File tree Expand file tree Collapse file tree 2 files changed +38
-6
lines changed
src/GlobalSignCAProxy/Api Expand file tree Collapse file tree 2 files changed +38
-6
lines changed Original file line number Diff line number Diff line change @@ -90,10 +90,26 @@ public BmV2PvOrderRequest Request
9090 Logger . Info ( $ "SAN Entry { item } matches CN, removing from request") ;
9191 continue ;
9292 }
93- if ( string . Equals ( item , $ "*. { CommonName } " , System . StringComparison . OrdinalIgnoreCase )
94- || string . Equals ( $ "*.{ item } " , CommonName , System . StringComparison . OrdinalIgnoreCase ) )
93+ string trimCN = CommonName , trimItem = item ;
94+ if ( trimCN . StartsWith ( "*." ) )
9595 {
96- Logger . Info ( $ "SAN Entry { item } is equivalent to CN ignoring wildcards, removing from request") ;
96+ trimCN = trimCN . Substring ( 2 ) ;
97+ }
98+ else if ( trimCN . StartsWith ( "www." ) )
99+ {
100+ trimCN = trimCN . Substring ( 4 ) ;
101+ }
102+ if ( trimItem . StartsWith ( "*." ) )
103+ {
104+ trimItem = trimItem . Substring ( 2 ) ;
105+ }
106+ else if ( trimItem . StartsWith ( "www." ) )
107+ {
108+ trimItem = trimItem . Substring ( 4 ) ;
109+ }
110+ if ( string . Equals ( trimCN , trimItem , System . StringComparison . OrdinalIgnoreCase ) )
111+ {
112+ Logger . Info ( $ "SAN Entry { item } is equivalent to CN ignoring wildcards or www prefix, removing from request") ;
97113 continue ;
98114 }
99115 SANEntry entry = new SANEntry ( ) ;
Original file line number Diff line number Diff line change @@ -44,10 +44,26 @@ public GlobalSignRenewRequest(GlobalSignCAConfig config) : base(config) { }
4444 Logger . Info ( $ "SAN Entry { item } matches CN, removing from request") ;
4545 continue ;
4646 }
47- if ( string . Equals ( item , $ "*. { CommonName } " , System . StringComparison . OrdinalIgnoreCase )
48- || string . Equals ( $ "*.{ item } " , CommonName , System . StringComparison . OrdinalIgnoreCase ) )
47+ string trimCN = CommonName , trimItem = item ;
48+ if ( trimCN . StartsWith ( "*." ) )
4949 {
50- Logger . Info ( $ "SAN Entry { item } is the same base domain as the wildcard CN, removing from request") ;
50+ trimCN = trimCN . Substring ( 2 ) ;
51+ }
52+ else if ( trimCN . StartsWith ( "www." ) )
53+ {
54+ trimCN = trimCN . Substring ( 4 ) ;
55+ }
56+ if ( trimItem . StartsWith ( "*." ) )
57+ {
58+ trimItem = trimItem . Substring ( 2 ) ;
59+ }
60+ else if ( trimItem . StartsWith ( "www." ) )
61+ {
62+ trimItem = trimItem . Substring ( 4 ) ;
63+ }
64+ if ( string . Equals ( trimCN , trimItem , System . StringComparison . OrdinalIgnoreCase ) )
65+ {
66+ Logger . Info ( $ "SAN Entry { item } is equivalent to CN ignoring wildcards or www prefix, removing from request") ;
5167 continue ;
5268 }
5369 SANEntry entry = new SANEntry ( ) ;
You can’t perform that action at this time.
0 commit comments