Initialize-HarborTls
One-time, ELEVATED: sets up HTTPS for the Harbor consoles on this machine – a certificate (generated, reused or yours) bound in http.sys to both consoles’ ports. Exported by both products.
Syntax
Section titled “Syntax”Initialize-HarborTls [[-Port] <int[]>] [[-CertThumbprint] <string>] [[-Hostname] <string[]>] [[-ValidYears] <int>] [-AllowRemote] [-TrustRoot] [-Renew] [-Force] [-WhatIf] [-Confirm]Description
Section titled “Description”Without -CertThumbprint it reuses Harbor’s own certificate while it has more than 30 days left (or always generates a new one with -Renew). With -TrustRoot the leaf certificate is also trusted machine-wide, so browsers show no warning. Re-running is safe: each binding is swapped in place, and a failure on any port restores every port already changed (both consoles stay on one scheme). After it, start the consoles normally – they serve https on the same ports. If CyberArk SSO is configured, register https://localhost:8787/auth/callback and https://localhost:8788/auth/callback in the Identity app (keep the http ones until every console has moved).
Examples
Section titled “Examples”Example 1
Section titled “Example 1”Initialize-HarborTls -TrustRoot # loopback consoles, trusted certExample 2
Section titled “Example 2”Initialize-HarborTls -CertThumbprint AB12... -AllowRemote -Hostname harbor.corp.localParameters
Section titled “Parameters”-AllowRemote
Section titled “-AllowRemote”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
-CertThumbprint
Section titled “-CertThumbprint”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String |
No | 1 | No |
-Confirm
Section titled “-Confirm”Asks for confirmation before the command changes anything.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
Aliases: cf.
-Force
Section titled “-Force”Replace a binding that belongs to another application (otherwise refused).
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
-Hostname
Section titled “-Hostname”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
String[] |
No | 2 | No |
Default: @().
Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
Int32[] |
No | 0 | No |
Default: $script:HarborTlsPorts.
-Renew
Section titled “-Renew”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
-TrustRoot
Section titled “-TrustRoot”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
-ValidYears
Section titled “-ValidYears”Not described in the module help.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
Int32 |
No | 3 | No |
Default: 2.
-WhatIf
Section titled “-WhatIf”Shows what the command would do, without doing it.
| Type | Required | Position | Pipeline input |
|---|---|---|---|
SwitchParameter |
No | Named | No |
Aliases: wi.
This command also accepts the PowerShell common parameters (-Verbose, -ErrorAction, and so on).
See also
Section titled “See also”- All Harbor Onboard cmdlets
- In PowerShell:
Get-Help Initialize-HarborTls -Full
Covers Harbor Onboard 0.59.0 / Harbor Health 0.22.0. On an older release? Upgrading and the release notes list what changed.
