Cannot import certificate using the new step template

Hello,

I am trying to use the new importing certificate functionality of Octopus. I have created one certificate and trying to deploy it on 2 machines. It works on one of them, but not on the other. I have attached the log file. I get a JSON parse error.

Best,
Boyan

ServerTasks-20015.log.txt (9 KB)

Hi Boyan,

I’m sorry you’re encountering this error.

It seems that error is occurring when we are attempting to deserialize the Private-Key Access Rules. Given this works on one machine, but not another, I’m assuming you are binding your access rules to Octopus variables (i.e. using an Octopus variable for the domain name of the account to grant access to the private key). Is this correct?

If so, then I’ll create an issue for us to support this, but in the meantime I think it may work if you use \\ instead of \ in your variable value.

Or am I off track?

Regards,
Michael

Hi Michael,

You are totally right. We use an access rule, but the difference is on MACHINE-1 it is a local user (eg., abcde), while on MACHINE-2, where it fails, it is a domain user (eg., domain\abcde). I will try to escape the slash there and see if it works this way.

Regards,
Boyan

I’ve raised an issue for this, which we will resolve as soon as possible.

Again, we apologize for any incovenience.

Thank you, Michael :slight_smile:

Hello again,

Just wanted to report 2 other issues:

  • I tried to remove my access rule from the step, but it doesn’t get saved. When I open the step again, the rule is still there.
  • I try to import two different certificates, issues by the same org, but when I import the 2nd certificate, the info shown is the one for the 1st certificate. I can install both certificates on my machine and they are totally different, but it seems Octopus does some check and thinks it is the same certificate (I can provide more info on this one, if necessary)

Best,
Boyan

Boyan,

I have replicated the issue with not persisting the removed access-rule. We will certainly resolve this ASAP.

Regarding the certificate display issue, could you possibly supply some screenshots? I’m not sure what could be happening there.

Thanks,
Michael

Hi Michael,

Sorry for the late reply. I believe the 2nd issue is related to https://github.com/OctopusDeploy/Issues/issues/3248 so it should be fixed now (will test soon)

Best,
Boyan

I was hoping that may be the case.
Of course let us know if the issue remains.