@@ -721,7 +721,7 @@ public async Task Synchronize(BlockingCollection<AnyCAPluginCertificate> blockin
721721
722722 caList . ForEach ( c => c . ToUpper ( ) ) ;
723723
724- List < string > divFilters = new List < string > ( ) { "" } ;
724+ List < string > divFilters = null ;
725725 if ( ! string . IsNullOrEmpty ( _config . SyncDivisionFilter ) )
726726 {
727727 divFilters = new List < string > ( ) ;
@@ -744,9 +744,26 @@ public async Task Synchronize(BlockingCollection<AnyCAPluginCertificate> blockin
744744 long starttime = time ;
745745 _logger . LogDebug ( $ "SYNC: Starting sync at time { time } ") ;
746746 List < Order > allOrders = new List < Order > ( ) ;
747- foreach ( string div in divFilters )
747+ if ( divFilters != null )
748748 {
749- ListCertificateOrdersResponse ordersResponse = client . ListAllCertificateOrders ( ignoreExpired , expiredWindow , div ) ;
749+ foreach ( string div in divFilters )
750+ {
751+ ListCertificateOrdersResponse ordersResponse = client . ListAllCertificateOrders ( ignoreExpired , expiredWindow , div ) ;
752+ if ( ordersResponse . Status == CertCentralBaseResponse . StatusType . ERROR )
753+ {
754+ Error error = ordersResponse . Errors [ 0 ] ;
755+ _logger . LogError ( "Error in listing all certificate orders" ) ;
756+ throw new Exception ( $ "DigiCert CertCentral web service returned { error . code } - { error . message } when retrieving all rows") ;
757+ }
758+ else
759+ {
760+ allOrders . AddRange ( ordersResponse . orders ) ;
761+ }
762+ }
763+ }
764+ else
765+ {
766+ ListCertificateOrdersResponse ordersResponse = client . ListAllCertificateOrders ( ignoreExpired , expiredWindow , null ) ;
750767 if ( ordersResponse . Status == CertCentralBaseResponse . StatusType . ERROR )
751768 {
752769 Error error = ordersResponse . Errors [ 0 ] ;
@@ -1401,7 +1418,7 @@ private List<AnyCAPluginCertificate> GetAllConnectorCertsForOrder(string caReque
14011418 if ( status == ( int ) EndEntityStatus . GENERATED || status == ( int ) EndEntityStatus . REVOKED )
14021419 {
14031420 // We have a status where there may be a cert to download, try to download it
1404- CertificateChainResponse certificateChainResponse = client . GetCertificateChain ( new CertificateChainRequest ( certId ) ) ;
1421+ CertificateChainResponse certificateChainResponse = client . GetCertificateChain ( new CertificateChainRequest ( $ " { cert . certificate_id } " ) ) ;
14051422 if ( certificateChainResponse . Status == CertCentralBaseResponse . StatusType . SUCCESS )
14061423 {
14071424 certificate = certificateChainResponse . Intermediates [ 0 ] . PEM ;
0 commit comments