Include Certificate in Deploy Package

I have a certificate stored in the Certificates section in Octopus.

During a deploy, I do not want to install it in the computers certificate store or use it in IIS https bindings.

I want to just be able to place it in the deployment folder where the rest of my application gets extracted to. I could not figure out a way to accomplish this. Is this possible?

Hi @James12,

Thanks for getting in touch! Octopus has a built in certificate store which lets you do what you are after here.

Let me know if this helps, or if you have any further questions.

Best regards,
Daniel

I already have my certificate in the Octopus built in certificate store, but there appears to be only two things you can do with a certificate:

  1. Import it into a Windows Certificate store on a target machine.
  2. Use it in HTTPS binding in IIS

I don’t want to do either of these. I want to treat it like a file and basically FTP as is to a local folder.

I was able to figure out a way to do this with powershell via a “Post-deployment script” in the deploy package step:

#Get Certificate Values
$certName = $OctopusParameters["My.Cert.Name"]
$b64 = $OctopusParameters["My.Cert.RawOriginal"]
$certFullFilePath = Join-Path -Path $cerPath -ChildPath $certName

#Create the Certificate File
$bytes = [Convert]::FromBase64String($b64)
[IO.File]::WriteAllBytes($certFullFilePath, $bytes)

Hi James,

Thanks for the update here! I’m glad you found and shared your solution here. :slight_smile:

Please feel free to get in touch at any time.

Best regards,
Daniel

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.