@@ -135,6 +135,12 @@ public static void InitCfg(
135135 // Create web.config;
136136 InitWeb ( cfgFileName , overwrite , verbose ) ;
137137
138+ // Create account
139+ using ( var ac = new AcmeContext ( cfgStore . ServerUri ) ) {
140+ cfgStore . SerializedAccountData = ac . RegisterAndLogin ( cfgStore . EmailAddress ) ;
141+ }
142+ SaveConfig ( cfgFileName ) ;
143+
138144 // Display farewell message
139145 Console . WriteLine ( "There are some additional options you can set in configuration file directly." ) ;
140146 Console . WriteLine ( "See documentation at www.autoacme.net for reference." ) ;
@@ -189,6 +195,7 @@ public static void AddHost(
189195
190196 if ( string . IsNullOrEmpty ( cfgStore . SerializedAccountData ) ) {
191197 cfgStore . SerializedAccountData = ac . RegisterAndLogin ( cfgStore . EmailAddress ) ;
198+ SaveConfig ( cfgFileName ) ;
192199 }
193200 else {
194201 ac . Login ( cfgStore . SerializedAccountData ) ;
@@ -208,6 +215,7 @@ public static void AddHost(
208215 Trace . WriteLine ( string . Empty ) ;
209216 Trace . WriteLine ( ex ) ;
210217 }
218+ CrashExit ( "Unable to get certificate for new host." ) ;
211219 }
212220
213221 if ( result != null ) {
@@ -403,6 +411,7 @@ public static void Renew(
403411
404412 if ( string . IsNullOrEmpty ( cfgStore . SerializedAccountData ) ) {
405413 cfgStore . SerializedAccountData = ac . RegisterAndLogin ( cfgStore . EmailAddress ) ;
414+ SaveConfig ( cfgFileName ) ;
406415 }
407416 else {
408417 ac . Login ( cfgStore . SerializedAccountData ) ;
@@ -414,6 +423,7 @@ public static void Renew(
414423 Trace . WriteLine ( string . Empty ) ;
415424 Trace . WriteLine ( ex ) ;
416425 }
426+ CrashExit ( "Unable to login or create account." ) ;
417427 }
418428
419429 // Renew them
0 commit comments