Network - Add SSL Certificate Binding

Octopus.Script exported 2017-07-04 by bobjwalker belongs to ‘HTTP’ category.

Creates (replaces) an SSL certificate binding to a specific hostname and port using NETSH.

Parameters

When steps based on the template are included in a project’s deployment process, the parameters below can be set.

Hostname and Port

HostnamePort =

The hostname and port to bind to. Example: example.com:443

Cert Hash

CertHash =

The certificate thumbprint (no spaces). Example: b087166a9f5cd6d75e5ba91105baa022658460de

App Id

AppId =

The application identifier, can be any GUID value. Example: {06aabebd-3a91-4b80-8a15-adfd3c8a0b14}

Certificate Store

CertStore = My

The certificate store where the certificate lives. Example: My

Script body

Steps based on this template will execute the following PowerShell script.

$hostnameport = $OctopusParameters['HostnamePort']
$certhash = $OctopusParameters['CertHash']
$appid = $OctopusParameters['AppId']
$certstore = $OctopusParameters['CertStore']

$delcert = "http delete sslcert hostnameport=""$hostnameport"""
write-host "Removing Cert: $delcert"
$delcert | netsh | out-host

$addcert = "http add sslcert hostnameport=""$hostnameport"" certhash=""$certhash"" appid=""$appid"" certstore=$certstore"
write-host "Creating Certificate Binding: $addcert"
$addcert | netsh | out-host

Provided under the Apache License version 2.0.

Report an issue

To use this template in Octopus Deploy, copy the JSON below and paste it into the Library → Step templates → Import dialog.

{
  "Id": "5a4857cf-dddc-4a08-a32e-8dfe018d986a",
  "Name": "Network - Add SSL Certificate Binding",
  "Description": "Creates (replaces) an SSL certificate binding to a specific hostname and port using NETSH.",
  "Version": 2,
  "ExportedAt": "2017-07-04T10:34:05.300Z",
  "ActionType": "Octopus.Script",
  "Author": "bobjwalker",
  "Parameters": [
    {
      "Name": "HostnamePort",
      "Label": "Hostname and Port",
      "HelpText": "The hostname and port to bind to. Example: example.com:443",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "CertHash",
      "Label": "Cert Hash",
      "HelpText": "The certificate thumbprint (no spaces). Example: b087166a9f5cd6d75e5ba91105baa022658460de",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "AppId",
      "Label": "App Id",
      "HelpText": "The application identifier, can be any GUID value. Example: {06aabebd-3a91-4b80-8a15-adfd3c8a0b14}",
      "DefaultValue": "",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "CertStore",
      "Label": "Certificate Store",
      "HelpText": "The certificate store where the certificate lives. Example: My",
      "DefaultValue": "My",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    }
  ],
  "Properties": {
    "Octopus.Action.Script.ScriptBody": "$hostnameport = $OctopusParameters['HostnamePort']\n$certhash = $OctopusParameters['CertHash']\n$appid = $OctopusParameters['AppId']\n$certstore = $OctopusParameters['CertStore']\n\n$delcert = \"http delete sslcert hostnameport=\"\"$hostnameport\"\"\"\nwrite-host \"Removing Cert: $delcert\"\n$delcert | netsh | out-host\n\n$addcert = \"http add sslcert hostnameport=\"\"$hostnameport\"\" certhash=\"\"$certhash\"\" appid=\"\"$appid\"\" certstore=$certstore\"\nwrite-host \"Creating Certificate Binding: $addcert\"\n$addcert | netsh | out-host",
    "Octopus.Action.Script.Syntax": "PowerShell",
    "Octopus.Action.Script.ScriptSource": "Inline",
    "Octopus.Action.Script.ScriptFileName": null,
    "Octopus.Action.Package.NuGetFeedId": null,
    "Octopus.Action.Package.NuGetPackageId": null
  },
  "Category": "HTTP",
  "HistoryUrl": "https://github.com/OctopusDeploy/Library/commits/master/step-templates//opt/buildagent/work/75443764cd38076d/step-templates/network-add-ssl-certificate-binding.json",
  "Website": "/step-templates/5a4857cf-dddc-4a08-a32e-8dfe018d986a",
  "Logo": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAB1dJREFUeNrsnc8uO18Yh1ERoRKJ+CYkLNljzwVwAXoBdQHs6V7t6wLaC+AC2GPP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1znWiNVlxsfHYx7mBMRKuo2RkcnJydvbWw734NCLWzqGx8dHbWtxcXFsbIzjniGS3dLpnVji9fVVOfH9/R23MsTExMTCwkKqxYKMipXL5RhugEEabgDEAkAsQCxALADEAsQCxAJALEAsQCwAxALEAsQCQCxALEAsAMQCxALEAkAsQCxALADEAsSCv0qSR+wBEAsQCxALALEAsQCxABALEAsQCwCxALEAsQAQCxALEAsAsQCxALEAEAsQCxALALEAsQCxABALEAsQCwCxALEAsQAQCxALMsV/AgwA3l1/9Yi7khIAAAAASUVORK5CYII=",
  "$Meta": {
    "Type": "ActionTemplate"
  }
}

History

Page updated on Tuesday, July 4, 2017