@@ -531,7 +531,7 @@ int main(int argc, char **argv)
531531 const char * user = NULL ;
532532 char * nutauth = NULL , str_port [16 ];
533533 upscli_authconf_t * ac_default = NULL ;
534- int flags_ssl = UPSCLI_CONN_TRYSSL ;
534+ int flags_ssl = UPSCLI_CONN_TRYSSL , flags_ssl_default = UPSCLI_CONN_TRYSSL ;
535535 struct passwd * new_uid = NULL ;
536536 const char * pidfilebase = prog ;
537537 /* For legacy single-ups -s/-l args: */
@@ -723,15 +723,15 @@ int main(int argc, char **argv)
723723 } else {
724724 if (!strcmp (nutauth , "default" )) {
725725 upsdebugx (1 , "Using nutauth='%s': require a user or system provided file" , nutauth );
726- upscli_read_authconf_file (NULL , 1 );
726+ upscli_read_authconf_file (NULL , 1 , -1 );
727727 } else {
728728 upsdebugx (1 , "Using nutauth='%s': require this file" , nutauth );
729- upscli_read_authconf_file (nutauth , 1 );
729+ upscli_read_authconf_file (nutauth , 1 , -1 );
730730 }
731731 }
732732 } else {
733733 upsdebugx (1 , "Using best-effort auth config detection" );
734- upscli_read_authconf_file (NULL , 0 );
734+ upscli_read_authconf_file (NULL , 0 , 1 );
735735 }
736736
737737 if (upscli_init_default_connect_timeout (net_connect_timeout , NULL , UPSCLI_DEFAULT_CONNECT_TIMEOUT ) < 0 ) {
@@ -854,12 +854,14 @@ int main(int argc, char **argv)
854854 /* Always call this, to register possible CERTHOSTs etc. */
855855 if (upscli_init_authconf (ac_current ) > 0 ) {
856856 if (ac_default ) {
857- upscli_authconf_update_conn_flags (ac_default , & flags_ssl );
857+ upscli_authconf_update_conn_flags (ac_default , & flags_ssl_default );
858858
859859 // Do not call on the next loop cycle, if any
860860 ac_default = NULL ;
861861 }
862862 }
863+ flags_ssl = flags_ssl_default ;
864+ upscli_authconf_update_conn_flags (ac_current , & flags_ssl );
863865
864866 /* Revise the list if some UPS name was an asterisk
865867 * (query the data server) */
0 commit comments