Deployment task fails System.NullReferenceException

Hi
Well title says it all I guess… I get a cert but the “store” process fails:

2020-09-30 01:01:37.795 +02:00 [INF] Requesting Certificate via Certificate Authority
2020-09-30 01:01:41.495 +02:00 [INF] Completed Certificate Request.
2020-09-30 01:01:41.517 +02:00 [INF] Performing Automated Certificate Binding
2020-09-30 01:01:42.649 +02:00 [INF] Completed certificate request and automated bindings update (IIS)
2020-09-30 01:01:43.755 +02:00 [INF] Request completed
2020-09-30 01:01:43.756 +02:00 [INF] Performing Post-Request (Deployment) Tasks..
2020-09-30 01:01:43.767 +02:00 [INF] Task [Store Certificate] :: Task is enabled and primary request was successful.
2020-09-30 01:01:43.779 +02:00 [ERR] Store Certificate (Certificate Store (Local Machine)) :: Task Failed with Exception :: System.NullReferenceException: Object reference not set to an instance of an object.
   at Certify.Providers.DeploymentTasks.Core.CertificateStore.<Execute>d__9.MoveNext() in C:\Work\GIT\certify_dev\certify\src\Certify.Core\Management\DeploymentTasks\Core\CertificateStore.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Certify.Providers.DeploymentTasks.DeploymentTask.<Execute>d__10.MoveNext() in C:\Work\GIT\certify_dev\certify\src\Certify.Core\Management\DeploymentTasks\DeploymentTask.cs:line 44
2020-09-30 01:01:43.779 +02:00 [INF] Store Certificate :: Store Certificate (Certificate Store (Local Machine)) :: Task Failed with Exception :: System.NullReferenceException: Object reference not set to an instance of an object.
   at Certify.Providers.DeploymentTasks.Core.CertificateStore.<Execute>d__9.MoveNext() in C:\Work\GIT\certify_dev\certify\src\Certify.Core\Management\DeploymentTasks\Core\CertificateStore.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Certify.Providers.DeploymentTasks.DeploymentTask.<Execute>d__10.MoveNext() in C:\Work\GIT\certify_dev\certify\src\Certify.Core\Management\DeploymentTasks\DeploymentTask.cs:line 44
2020-09-30 01:01:43.779 +02:00 [INF] Deployment Tasks did not complete successfully.

Any idea where I should start diagnosing this ?

Thanks, I’ll investigate and see if I can reproduce.

  • Which options are you using?
  • Are you using a custom PFX password? Reviewing the code now I don’t think that will currently work.

Note also that the standard Deployment Modes will store the certificate in the local machine store under Personal/My so by default the cert is already in the store, the main advantage of the Store task is to let you specify the friendly name.

So the issue was probably from not specifying a Friendly Name, we should probably consider making that non-optional. Fix in next version.

  • Which options are you using?

All default options - just added a deployment task “Store certificate” on success

  • Are you using a custom PFX password? Reviewing the code now I don’t think that will currently work.

No

Where should I input it ?

Edit the task and go to the Task Parameters tab. image

Out of interest what is your use case for storing the certificate with custom settings (standard deployment already stores the cert)?

Actually none, that was my goal… did not look closely enough :slight_smile:

1 Like

Cool, well you helped find a bug anyway!