@@ -54,6 +54,9 @@ def generate_crt_bundle(subj, subj_nginx, forced=False):
5454 generate_nginx_certs (subj_nginx , ca_bundle_file , ca_key_file )
5555 else :
5656 print_log ("CRT Bundle" , "Nothing to do. The file already exists." )
57+ nginx_cert_file = os .path .join (BASEDIR_CA , "nginx.crt" )
58+ if not os .path .isfile (nginx_cert_file ):
59+ generate_nginx_certs (subj_nginx , ca_bundle_file , ca_key_file )
5760
5861
5962def generate_nginx_certs (subj , ca_bundle_file , ca_key_file ):
@@ -280,6 +283,12 @@ def remove_blocklist(urls):
280283 action = "store_true" ,
281284 default = False ,
282285 )
286+ parser .add_argument (
287+ "--regenerate-nginx-certs" ,
288+ help = "Regenerate nginx certificates" ,
289+ action = "store_true" ,
290+ default = False ,
291+ )
283292 parser .add_argument (
284293 "--crt-bundle-subj" ,
285294 type = str ,
@@ -350,6 +359,12 @@ def remove_blocklist(urls):
350359 need_restart = generate_crt_bundle (
351360 args .crt_bundle_subj , args .nginx_subj , forced = True
352361 )
362+ if args .regenerate_nginx_certs :
363+ ca_bundle_file = os .path .join (BASEDIR_CA , "privoxy-ca-bundle.crt" )
364+ ca_key_file = os .path .join (BASEDIR_CA , "cakey.pem" )
365+ need_restart = generate_nginx_certs (
366+ args .nginx_subj , ca_bundle_file , ca_key_file
367+ )
353368 if args .update_adblock_filters :
354369 need_restart = update_adblock_filters ()
355370 if args .add_whitelist :
0 commit comments