@@ -169,6 +169,15 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
169169 installOptions .BaseURL = customBaseURL
170170 }
171171
172+ var caBundle []byte
173+ if bootstrapArgs .caFile != "" {
174+ var err error
175+ caBundle , err = os .ReadFile (bootstrapArgs .caFile )
176+ if err != nil {
177+ return fmt .Errorf ("unable to read TLS CA file: %w" , err )
178+ }
179+ }
180+
172181 // Source generation and secret config
173182 secretOpts := sourcesecret.Options {
174183 Name : bootstrapArgs .secretName ,
@@ -179,10 +188,7 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
179188 if bootstrapArgs .tokenAuth {
180189 secretOpts .Username = gitArgs .username
181190 secretOpts .Password = gitArgs .password
182-
183- if bootstrapArgs .caFile != "" {
184- secretOpts .CAFilePath = bootstrapArgs .caFile
185- }
191+ secretOpts .CAFile = caBundle
186192
187193 // Remove port of the given host when not syncing over HTTP/S to not assume port for protocol
188194 // This _might_ be overwritten later on by e.g. --ssh-hostname
@@ -213,9 +219,12 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
213219 if bootstrapArgs .sshHostname != "" {
214220 repositoryURL .Host = bootstrapArgs .sshHostname
215221 }
216- if bootstrapArgs .privateKeyFile != "" {
217- secretOpts .PrivateKeyPath = bootstrapArgs .privateKeyFile
222+
223+ keypair , err := sourcesecret .LoadKeyPairFromPath (bootstrapArgs .privateKeyFile , gitArgs .password )
224+ if err != nil {
225+ return err
218226 }
227+ secretOpts .Keypair = keypair
219228
220229 // Configure last as it depends on the config above.
221230 secretOpts .SSHHostname = repositoryURL .Host
@@ -235,13 +244,9 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
235244 RecurseSubmodules : bootstrapArgs .recurseSubmodules ,
236245 }
237246
238- var caBundle []byte
239- if bootstrapArgs .caFile != "" {
240- var err error
241- caBundle , err = os .ReadFile (bootstrapArgs .caFile )
242- if err != nil {
243- return fmt .Errorf ("unable to read TLS CA file: %w" , err )
244- }
247+ entityList , err := bootstrap .LoadEntityListFromPath (bootstrapArgs .gpgKeyRingPath )
248+ if err != nil {
249+ return err
245250 }
246251
247252 // Bootstrap config
@@ -254,7 +259,7 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
254259 bootstrap .WithPostGenerateSecretFunc (promptPublicKey ),
255260 bootstrap .WithLogger (logger ),
256261 bootstrap .WithCABundle (caBundle ),
257- bootstrap .WithGitCommitSigning (bootstrapArgs . gpgKeyRingPath , bootstrapArgs .gpgPassphrase , bootstrapArgs .gpgKeyID ),
262+ bootstrap .WithGitCommitSigning (entityList , bootstrapArgs .gpgPassphrase , bootstrapArgs .gpgKeyID ),
258263 }
259264
260265 // Setup bootstrapper with constructed configs
0 commit comments